forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: biellebrunner on November 03, 2016, 02:06:09 am

Title: Different theme in a specific category
Post by: biellebrunner on November 03, 2016, 02:06:09 am
I've found this thread (http://forum.coppermine-gallery.net/index.php/topic,22781.0.html) with a tutorial to do just that in cpg 1.4, but I assume it won't work for 1.5.
Is it possible to do that in cpg 1.5? Is there maybe a plugin or something?
Title: Re: Different theme in a specific category
Post by: allvip on December 15, 2016, 02:28:46 pm
This allows you do add diffrent styles or diffrent css files for every category and all the pages in it or for every category and every album.

Wrapp every subcategories in diffrent divs (dinamyc id for the body ) http://forum.coppermine-gallery.net/index.php/topic,77231.0.html (http://forum.coppermine-gallery.net/index.php/topic,77231.0.html)


If you really need themes for every category, I can help you with that too.
Title: Re: Different theme in a specific category
Post by: ron4mac on December 19, 2016, 01:26:31 am
You'll have to make a 1 line modification to include/init.inc.php, and then the attached plugin should provide what you want.

In CPG 1.5.44, just before line 301 in include/init.inc.php (line 304 in CPG 1.6.01):
Code: [Select]
if (!file_exists('themes/'.$CONFIG['theme'].'/theme.php')) {
add the line:
Code: [Select]
$CONFIG['theme'] = CPGPluginAPI::filter('theme_name', $CONFIG['theme']);
( It's possible that line will become a permanent part of new releases )

This was put together rather quickly and not every circumstance was fully tested. Let me know whether it works okay for you.

Updated 21 Dec 2016: Sub-categories default to parent theme.
Updated 23 Feb 2017: Correct issue with meta albums.