SimplePortal

Development => Feature Requests => Topic started by: velorooms on January 09, 2013, 04:15:14 PM

Title: [Feature Request] Enable blocks in certain themes.
Post by: velorooms on January 09, 2013, 04:15:14 PM
Now this one might involve a fair amount of coding so I dont know if its possible or realistically feasible.

An option added to display options to set the theme in which the block appears, so all themes, or just certain themes. As more and more people start using tablets, or mobiles, more smf forums have alternate themes for these devices, and a way of only including certain blocks in certain themes would be superb (so strip out unneeded blocks in mobile themes but keep some), or even for making less bulky themes for those that dont want them.

Title: Re: [Feature Request] Enable blocks in certain themes.
Post by: velorooms on January 09, 2013, 04:50:11 PM
Hmm, digging around, this from November 2011

Hello...

It would be great if we had Theme based blocks. So that means that you can choose on what theme you want to show the block.

You'll be able to do this with 2.3.4 version, which will be out very very soon, using Complex Display Options.

I'm also planning to add a proper interface to select particular themes and languages to display the blocks on too. But that will be for the next major version.

but checking the documentation its not listed in any of the advanced display options

http://simpleportal.net/index.php?action=docs;area=custom_blocks_display

The release of 2.3.4 was late november that year and Sinan listed in the features:
Quote
Complex display options using PHP expressions for block display.

got as far as learning that you can put in custom options

$php followed by an expression..

Oh lordy..

hmmmm..,.
Title: Re: [Feature Request] Enable blocks in certain themes.
Post by: velorooms on January 15, 2013, 01:17:19 PM
Nobody :( Wheres Sinan..  >:-D
Title: Re: [Feature Request] Enable blocks in certain themes.
Post by: velorooms on January 16, 2013, 09:35:20 AM
Ok. ive managed to get somewhere with this one, but not in the way I would like but (ie. defining in the block admin where to show the block) but by editing the php similar to what is used to hide the two side panels in a certain theme

Code: [Select]
$block_in_theme = array(38);
if (in_array($settings['theme_id'], $block_in_theme))
$blocks = array_merge(getBlockInfo(false, 227, false, false), $blocks = getBlockInfo(false, 237, false, false), $blocks = getBlockInfo(false, 168, false, false));
else

then by hiding these three blocks, it forcibly includes them in theme number 38.
Only problem is, i can only so far get them to appear in header or footer, rather than top or bottom as I would like.
Title: Re: [Feature Request] Enable blocks in certain themes.
Post by: FireDitto on January 21, 2013, 05:20:18 AM
xD this request was exactly why I logged into SP today :D

I'd love to be able to select via what themes I'd like a block to show up on.
Title: Re: [Feature Request] Enable blocks in certain themes.
Post by: velorooms on January 27, 2013, 10:09:27 AM
well apparently its possible, but it appears to be a secret :D
SimplePortal 2.3.8 © 2008-2024, SimplePortal