hello
A kind of bad habits of coding gas spread among dev, even in the team. So I post this as a reminder and an overview of what's next in 2.5 about that.
This topic is only if your plugin create a new index page index.php/xxx.
1- $page['body_id'] and $page['section'] needs to be defined with custom values by the plugin -only recommended for $page['title']-, using the loc_end_section_init trigger. This is useful for other plugins and themes, in order to declare what type of page is currently running. And for the title -which should be translated-, it's only for SEO.
2- For Piwigo 2.6, a new .tpl file will be added in order to be compatible with template extensions and to easier allow styling for themes. Similar to a stripped index.tpl, it will looks like :
{$MENUBAR} {if isset($errors) or isset($infos)} <div class="content messages{if isset($MENUBAR)} contentWithMenu{/if}"> {include file='infos_errors.tpl'} </div> {/if} {if !empty($PLUGIN_INDEX_CONTENT_BEFORE)}{$PLUGIN_INDEX_CONTENT_BEFORE}{/if} <div id="content" class="content{if isset($MENUBAR)} contentWithMenu{/if}"> <div class="titrePage"> <ul class="categoryActions"> {if !empty($PLUGIN_INDEX_ACTIONS)}{$PLUGIN_INDEX_ACTIONS}{/if} </ul> <h2>{$TITLE}</h2> </div>{* <!-- titrePage --> *} {if !empty($CONTENT)} <div class="additional_info"> {$CONTENT} </div> {/if} {if !empty($PLUGIN_INDEX_CONTENT_END)}{$PLUGIN_INDEX_CONTENT_END}{/if} </div>{* <!-- content --> *} {if !empty($PLUGIN_INDEX_CONTENT_AFTER)}{$PLUGIN_INDEX_CONTENT_AFTER}{/if}
where $CONTENT could be any custom .tpl file parsed by the plugin like this :
$dir=dirname(__FILE__).'/user_tag.tpl'; $template->set_filenames(array( 'user_tag' => realpath($dir), ) ); $template->assign_var_from_handle('CONTENT', 'user_tag');
of course tgis is under development and a wiki article will be written
Thx for reading, if you have any questions, please do on that thread
Offline