Skip to content

JohannesFerner/contao-improvements

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 

Repository files navigation

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.

About

Collection of small improvements for Contao.

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published