Open plegall opened 8 years ago
It uses a completely different HTML template which is why it was easier to fork the original plugin and create a working clone. If this is possible without a fork, then I probably couldn't figure out how (and/or couldn't find documentation).
Piwigo is a great piece of software (and the best for photo hosting, I have tested them all) but extending it is extremely complicated and sparsely documented.
It would be great to see a future major update with simplified templating and extensions API which would hopefully attract pro theme developers to the platform.
To give an example, of what I'm getting at, we can look at header.tpl
in the default theme and there is a huge block of meta code:
{if isset($meta_ref)}
{if isset($INFO_AUTHOR)}
<meta name="author" content="{$INFO_AUTHOR|strip_tags:false|replace:'"':' '}">
{/if}
{if isset($related_tags)}
<meta name="keywords" content="{foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}{$tag.name}{/foreach}">
{/if}
{if isset($COMMENT_IMG)}
<meta name="description" content="{$COMMENT_IMG|strip_tags:false|replace:'"':' '}{if isset($INFO_FILE)} - {$INFO_FILE}{/if}">
{else}
<meta name="description" content="{$PAGE_TITLE}{if isset($INFO_FILE)} - {$INFO_FILE}{/if}">
{/if}
{/if}
<title>{if $PAGE_TITLE!=l10n('Home') && $PAGE_TITLE!=$GALLERY_TITLE}{$PAGE_TITLE} | {/if}{$GALLERY_TITLE}</title>
<link rel="shortcut icon" type="image/x-icon" href="{$ROOT_URL}{$themeconf.icon_dir}/favicon.ico">
<link rel="start" title="{'Home'|translate}" href="{$U_HOME}" >
<link rel="search" title="{'Search'|translate}" href="{$ROOT_URL}search.php" >
{if isset($first.U_IMG) }<link rel="first" title="{'First'|translate}" href="{$first.U_IMG}" >{/if}
{if isset($previous.U_IMG)}<link rel="prev" title="{'Previous'|translate}" href="{$previous.U_IMG}" >{/if}
{if isset($next.U_IMG) }<link rel="next" title="{'Next'|translate}" href="{$next.U_IMG}" >{/if}
{if isset($last.U_IMG) }<link rel="last" title="{'Last'|translate}" href="{$last.U_IMG}" >{/if}
{if isset($U_UP) }<link rel="up" title="{'Thumbnails'|translate}" href="{$U_UP}" >{/if}
{if isset($U_PREFETCH) }<link rel="prefetch" href="{$U_PREFETCH}">{/if}
{if isset($U_CANONICAL) }<link rel="canonical" href="{$U_CANONICAL}">{/if}
{if not empty($page_refresh)}<meta http-equiv="refresh" content="{$page_refresh.TIME};url={$page_refresh.U_REFRESH}">{/if}
Why can this not simply be:
{$META}
I'd personally like to see a better template engine used, like Twig but appreciate that you may be too invested in Smarty at this point.
The blogging platform Ghost is an excellent example of a really well designed platform for theming that is an absolute pleasure to work with.
OK, I will compare the 2 plugins to see how we can have it all in a single plugin :-)
I would be glad to have this discussion about improving the templating system (to simplify extensibility), but not here. Can you open a topic on Piwigo.org forum to discuss this and tell us how you would see the {$META} implemented.
Sounds good!
I'll repost on the forum in more detail, it's been something I've thought about a bit in the past but just been a bit out of the loop for the last few months as had hip surgery and have been focusing on rehab. Trying to put more of my time back into open source projects again now.
Hi @Philio
Why no making the original plugin compliant? we can perfectly adapt https://github.com/Piwigo/LanguageSwitch