Templating/Shortcodes Utilizing e107's Templating and Shortcode engine.

Templating Overview

  • Templates and shortcodes function together to allow a developer to place dynamic content into their code.
  • Templates are portions of HTML which contain markers that are replaced by dynamic content when parsed e107's parseTemplate()function.
  • These markers are called 'shortcodes'.
  • A shortcode is always CAPITALIZED and is surrounded by curly brackets and it may contain letters and underscores. For example: {MY_SHORTCODE}
  • Each shortcode has a corresponding function/method which is run during the parsing of the template. These functions are always lowercase and begin with the prefix sc_ . eg. sc_my_shortcode(). This means that {MY_SHORTCODE} is replaced by what is returned by sc_my_shortcode().
  • Shortcodes may also contain parameters which are sent to the corresponding method. For example: {MY_SHORTCODE: x=foo&y=bar}

Monday 21 March 2016 - 11:40:26 Tijn Kuyper,