Calling Plugins from the Content

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

Calling Plugins from the Content

Postby cmb » Fri Aug 03, 2012 10:54 pm

Hello Community,

many plugins are meant to be called from the content. How exactly this has to be done is described in the plugin's help. But typically there are 3 different ways to accomplish the same result:

  1. "classic" CMSimple scripting:
    Code: Select all
    #CMSimple $output=preg_replace("/".chr(35)."CMSimple.*?".chr(35)."/",plugin_function(),$c[$s]);#
  2. the "new" plugin call:
    Code: Select all
    {{{PLUGIN:plugin_function(...);}}}
  3. using the hi_pd_scripting plugin
If you're using (1) or (2) in combination with a WYSIWYG editor (e.g. tinyMCE or CKEditor) and the plugin call is on a separate "line", the editor will embed the plugin call in a <p> element. This often results in invalid (X)HTML [1] and in some cases might result in JS errors (particularly on IE) [2], so you should always change the format of the plugin call paragraph to <div>.

[1] many plugins use <div>s or other block level elements to structure their output, but inside a <p> no block level elements are allowed
[2] some plugins insert content dynamically with JS, but some browser's JS engines choke on invalid (X)HTML that should be created dynamically

Christoph
Christoph M. Becker---Plugins for CMSimple_XH
cmb
 
Posts: 5484
Joined: Tue Jun 21, 2011 11:04 am
Location: Germany

Return to Addons and Plugins

Who is online

Users browsing this forum: No registered users and 1 guest