Announcement

  •  » Extensions
  •  » Msg for creators of plugins which add a new index page index.php/xxx

#1 2013-01-31 16:30:57

flop25
Piwigo Team
2006-07-06
6801

Msg for creators of plugins which add a new index page index.php/xxx

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 :

Code:

{$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 :

Code:

  $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


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 
  •  » Extensions
  •  » Msg for creators of plugins which add a new index page index.php/xxx

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2018 · Contact