vitd/contentwidget

Magento 2.x Widget to include File or Url as Content. Callable in XML or PAGE

1.4.0 2018-06-19 15:29 UTC

This package is auto-updated.

Last update: 2024-04-23 03:11:43 UTC


README

Parameters

TypeParameterDescription
stringvitd_type'url' or 'file'.
stringvitd_urlThis value will used for both, URL or FILE.
selectvitd_force_include0 or 1. The file will included with include(), on else will file_get_contents() used.
selectvitd_force_reload0 or 1. This will adding a timestamp to the url.
selectvitd_container'', 'div' or 'iframe'. The content can have an clousure 'div' or 'iframe'.
numbervitd_iframe_widthDefine the IFRAME width.
numbervitd_iframe_heightDefine the IFRAME height.
selectvitd_string_conversion'' => no Conversion, 'utf8' => to UTF-8, 'win1252' => to Win1252 / Latin1 / ISO-8859, 'fix' => fix UTF-8 or 'fix1252' => fix UTF-8 with mixed Win1252.
selectvitd_nlbr0 or 1. This will replace all newlines to <br/>
selectvitd_escape_content0 or 1. This will escape the content with htmlentities($content, ENT_QUOTES | ENT_SUBSTITUTE)
numbervitd_timeoutdefault is 10 seconds
selectvitd_http_method'GET' or 'POST' default is GET
selectvitd_use_hoststable0 or 1. Use prefix url and hosts table configuration from the store configuration

Usage

Example usage in XML

<block class="Vitd\ContentWidget\Block\Widget\Content">
    <arguments>
        <argument name="vitd_type" xsi:type="string">url</argument>
        <argument name="vitd_url" xsi:type="string">/customContent.php</argument>
    </arguments>
</block>

Example usage in Page

// Minimlistic usage (defautl is type 'url'
{{widget type="Vitd\\ContentWidget\\Block\\Widget\\Content" vitd_url="/customContent.php"}}

Release Notes

v1.4.0 (2018-06-19)

  • New: Backend configuration to disable the output of the widget and show instead the URL or FILENAME

v1.3.0 (2018-06-05)

  • New: store configuration for the widget in path -> /stores/configuration/vitamin d/content widget
  • New parameter: vitd_use_hoststable

v1.2.2 (2018-03-06)

  • Bug: build url has not accepted absolute paths.

v1.2.0 (2018-03-03)

  • New parameter vitd_timeout
  • New parameter vitd_http_method
  • Catch exceptions for file_get_contents or scripts. Content will replaced with message, on abort by client will the content only cleared.
  • Constants moved to ContentWidgetConstInterface, this file has now all predefined default values (see for more in this class)
  • Code optimized