[geeklog-devel] Plugins and Templates and a bit about the Forum plugin

Tom websitemaster at cogeco.net
Sun Feb 15 18:48:48 EST 2015


If the customized plugin template files are stored with the theme (in the proper sub directory) they will not be lost.

If the customized plugin template files are stored in the plugins template directory under the theme's name, they shouldn't be lost unless the plugin install already contains customizations for the theme.

If the customized plugin template files are stored in the plugins template directory under the "default" directory... they will be lost if the plugin is upgraded and they overwrite the directory.

Tom

-----Original Message-----
From: geeklog-devel [mailto:geeklog-devel-bounces at lists.geeklog.net] On Behalf Of cordiste
Sent: February-15-15 3:01 PM
To: Geeklog Development
Subject: Re: [geeklog-devel] Plugins and Templates and a bit about the Forum plugin

With these new functions, do you think site owners can customise the themes of the plugins and store the custom files under the data folder to avoid loosing of data during update by uploading a plugin archive ?

Ben

2015-02-14 17:09 GMT+01:00 Tom <websitemaster at cogeco.net>:
> Okay,
>
>
>
> I have started on updated the forum plugin templates to be responsive.
> Thanks Ivy for the work you have done so far (which is a lot). I am 
> using your templates as my starting point.
>
>
>
> I have created 2 new functions in the template library that the forum 
> and core plugins will use to determine which templates to use when 
> displaying information.  I actually based the code on some I found in 
> the plugins that was not being used (must have been a partially implemented feature).
>
>
>
> To keep things consistent with the core plugins and to make theme 
> development easier, other plugins should go ahead and use these 
> functions where possible.
>
>
>
> The 2 functions are:
>
>
>
> CTL_plugin_templatePath($plugin, $path = '')
>
>
>
> CTL_plugin_cssURL($plugin, $filename = "style.css")
>
>
>
> The template function returns  the physical path directory location of 
> the plugin templates. This should be run at the beginning of your 
> plugins functions.inc and stored in your plugins config variables like so:
>
>
>
> $CONF_FORUM['path_layout'] = CTL_plugin_templatePath('forum');
>
>
>
> Similarly the css function returns the URL of the location of the css 
> file
>
>
>
> $CONF_FORUM['css_url'] = CTL_plugin_cssURL('forum', 'forum.css');
>
>
>
> The order of operation for the template function is
>
>
>
> 1)      It checks for a sub directory of the plugin’s name in the current
> theme being displayed root directory. If found it is used.
>
> 2)      It checks for a sub directory of the theme’s name in the current
> “plugins/plugin name here/templates/” directory. If found it is used.
>
> 3)      If 1 or 2 is not found then the default template for the plugin is
> used. It is always located in “plugins/plugin name here/templates/default/”
>
>
>
> This will hopefully make things easier for people when updating 
> plugins to maintain their template changes. It also makes it easier 
> for plugin developers to include plugin templates that support specific themes.
>
>
>
> When I have fully implemented everything I will update the repository.
>
>
>
> Thanks
>
>
>
> Tom
>
>
> _______________________________________________
> geeklog-devel mailing list
> geeklog-devel at lists.geeklog.net
> https://pairlist8.pair.net/mailman/listinfo/geeklog-devel
>
_______________________________________________
geeklog-devel mailing list
geeklog-devel at lists.geeklog.net
https://pairlist8.pair.net/mailman/listinfo/geeklog-devel




More information about the geeklog-devel mailing list