SimplePortal

Support => English Support => Topic started by: Joscerelle on May 09, 2013, 12:16:47 PM

Title: Changing Blocks When Changing Themes
Post by: Joscerelle on May 09, 2013, 12:16:47 PM
I'm trying to figure out how to best do this. I have images that I would like to display depending on which theme one chooses so that everything matches in colors. I'm not entirely sure how to do this. Does anyone have any suggestions or can they point me in the right direction?
Title: Re: Changing Blocks When Changing Themes
Post by: [SiNaN] on May 09, 2013, 01:35:09 PM
You can use Complex Display Options. When you are editing a block you have the Advanced Options checkbox in the Display Options area. When you click on that, you should be able to see the Custom Display Options textbox. As an admin you can add PHP expressions there using the $php prefix. For this specific purpose, you can use such a rule for Custom Display Options:

Code: [Select]
$php global $settings; return $settings['theme_id'] == 1 && {$action} == '';
A block with such a custom display option will only be displayed when the uses choses the theme with id 1 and view the portal page. You can modify it to your liking.
Title: Re: Changing Blocks When Changing Themes
Post by: Joscerelle on May 09, 2013, 03:52:20 PM
Your answer so far was very helpful, but unfortunately I am so new to php, like this afternoon new. Where do I find the theme ID and where in that code do I modify whether the block can be viewed on the portal, forums, or everywhere?
Title: Re: Changing Blocks When Changing Themes
Post by: ccbtimewiz on June 09, 2013, 12:04:25 AM
You can find the theme ID of a theme by actually looking at the URL of the theme. Go into your theme preferences (or administration panel) and look at the links that associate with each theme.
Title: Re: Changing Blocks When Changing Themes
Post by: AngelinaBelle on June 18, 2013, 08:01:27 AM
Joscerelle -- did that work?
SimplePortal 2.3.8 © 2008-2024, SimplePortal