Sobi2
FAQ
Templates & Design
How to execute Joomla Plugins in Templates |
Located in Templates & Design | Editing, Publishing Tagged with template, mambots, plugins, executing mambots |
|
|
|
| Written by Sigrid Suski |
| Last updated on Tuesday, 16 November 2010 |
If you need to execute Joomla plugins (formerly mambots) for some selected fields, the data from these fields have to be transferred to the function execJPlugins of the class HTML_SOBI.For example in details view template: <?php echo HTML_SOBI::execJPlugins( $fieldsFormatted['field_description'] ); ?> Or for non-formatted fields data: <?php echo HTML_SOBI::execJPlugins( $fieldsObjects['field_description']->data ); ?> You can also execute Joomla plugins for every other data. Like this: <?php echo HTML_SOBI::execJPlugins( "some text for some {plugin} plugin {/plugin}" ); ?> Sometimes it is necessary to execute Joomla plugins on the whole template. It is possible to do this too with a simple trick: <?php // start catching output ob_start(); ?> <?php echo $editButton; ?> <?php echo $deleteButton; ?> <?php echo $ico; ?> <?php echo $img; ?> <?php echo $title; ?> <?php echo $fieldsFormatted['field_street']; ?><br/> <?php echo $fieldsFormatted['field_postcode']; ?> <?php echo $fieldsFormatted['field_city']; ?><br/> <?php echo $fieldsFormatted['field_county']; ?><br/> <?php echo $fieldsFormatted['field_federal_state']; ?> <?php echo $fieldsFormatted['field_country']; ?><br/> <?php echo $fieldsFormatted['field_website']; ?> <?php // save catched output in variable $data = ob_get_contents(); // stop catching output ob_end_clean(); // execute Joomla plugins echo HTML_SOBI::execJPlugins( $data ); ?> |
| Published on Sunday, 30 March 2008. Visited 11381 times. |
| < Prev | Next > |
|---|
| Powered by Sigsiu.NET | ![]() |
Visitors: