Skip to content

Latest commit

 

History

History
78 lines (61 loc) · 2.03 KB

README.md

File metadata and controls

78 lines (61 loc) · 2.03 KB

Contao improvements

Collection of small improvements for contao.

  • Allow HTML in headlines of content elements, news and calendar events.
  • Allow long urls in content elements url fields. (normaly urls are limited to 255 characters)
  • Rename articles of the same title as the page, if the page is renamed.
  • Auto-Select the first text, checkbox, radio or select field in backend, if the edit mask is opened. (Improve speed of mass creating fields with keyboard shortcuts)
  • Add insert tag {{page::*}} to access every field of the $objPage object.
  • Add a lot of wrapper instert tags, for example {{base64_encode::*}}, see description below.

Wrapper insert tag

The wrapper insert tag is a flexible wrapper for other insert tags. The main syntax is {{<function>::<other insert tag>}}. <function> is a string expecting function, currently supported is:

  • base64_encode
  • base64_decode
  • rawurldecode
  • rawurlencode
  • urldecode
  • urlencode
  • crc32
  • crypt
  • html_entity_decode
  • htmlentities
  • htmlspecialchars_decode
  • htmlspecialchars
  • lcfirst
  • ltrim
  • md5
  • nl2br
  • ord
  • quoted_printable_decode
  • quoted_printable_encode
  • quotemeta
  • rtrim
  • sha1
  • soundex
  • str_rot13
  • str_shuffle
  • str_split
  • str_word_count
  • strip_tags
  • stripcslashes
  • stripslashes
  • strlen
  • strrev
  • strtolower
  • strtoupper
  • trim
  • ucfirst
  • ucwords
  • wordwrap
  • standardize

<other insert tag> can be every other insert tag, including the wrapper insert tag itself (see Recursive example).

Example

{{urlencode::env::url}}

Recursive example

{{htmlentities::htmlspecialchars::insert_article::123}}

Embedded example

<a href="{{link_url::123}}" rel="{{htmlspecialchars::strip_tags::insert_content::456}}">read more...</a>

Extending with custom wrapper functions

Everyone can extend the wrapper insert tag by adding a custom function to $GLOBALS['TL_INSERTTAG_WRAPPER'].

$GLOBALS['TL_INSERTTAG_WRAPPER'][] = 'customFunction';

The wrapper can only pass one parameter to the function, the result of the wrapped insert tag.