SimplePortal

Customization => Custom Coding => Topic started by: camealion on August 12, 2010, 05:20:40 PM

Title: Setting theme for custom pages
Post by: camealion on August 12, 2010, 05:20:40 PM
Is there a way where I can change the theme use on a sp page?

For example:
     http://www.mydomain.com/index.php?page=page_1    Would be one theme.
     http://www.mydomain.com/index.php?page=page_2    Would be another theme.

I tried searching to se if there was any way I could use ssi, but I had no luck.

Thanks
Title: Re: Setting theme for custom pages
Post by: ccbtimewiz on August 12, 2010, 06:42:25 PM
Before calling SSI, set the variable $ssi_theme with the numerical value of the theme's ID.

Eg;

Code: [Select]
$ssi_theme = 1;
require_once('SSI.php');

There are other various methods of manually editing the files to get the theme you want based on what page you're in. This was requested in the past as an in-built feature, however it seems to have been marked off as bloat and wasn't included.

You could try and convince the development team to include it by posting in the Feature Requests board.. or perhaps asking someone to mod it for you.
Title: Re: Setting theme for custom pages
Post by: camealion on August 13, 2010, 05:38:53 PM
Code: [Select]
$ssi_theme = 1;
require_once('SSI.php');
that did not work for me. :'(
Title: Re: Setting theme for custom pages
Post by: camealion on August 14, 2010, 09:49:00 AM
It works if I use it in a separate page I created by itself but it doesn't if I create the page with simple portal.  Any other idea's or is it even possible?
Title: Re: Setting theme for custom pages
Post by: AngelinaBelle on September 15, 2010, 08:19:20 PM
The difficulty here is that the theme selection has to be made long before the "custom php block" code is evaluated.
 
It would take changes right up at the top of the page.  Could be done, in approximately the same way as per-board custom themes are handled, but probably not high on the list of priorities.
 
You might suggest this as a feature.
Title: Re: Setting theme for custom pages
Post by: deansmar on September 16, 2010, 03:56:40 AM
could this not be achieved through the Style Options of the SP page..??

Default Title Class: 
Custom Title Class: 
Custom Title Style: 
Default Body Class: 
Custom Body Class: 
Custom Body Style: 
Title: Re: Setting theme for custom pages
Post by: Nathaniel on September 16, 2010, 04:03:51 AM
could this not be achieved through the Style Options of the SP page..??

Default Title Class: 
Custom Title Class: 
Custom Title Style: 
Default Body Class: 
Custom Body Class: 
Custom Body Style: 

No, the request is to change the SMF theme that the page is using, rather than the page template layout/appearance.

This is the main issue with having a Custom PHP block that is parsed within the templating system (even though it does simplify some stuff), if you are interested in this feature then post a request in the feature requests board.
Title: Re: Setting theme for custom pages
Post by: ccbtimewiz on September 16, 2010, 04:36:00 PM
Before calling SSI, set the variable $ssi_theme with the numerical value of the theme's ID.

Eg;

Code: [Select]
$ssi_theme = 1;
require_once('SSI.php');

There are other various methods of manually editing the files to get the theme you want based on what page you're in. This was requested in the past as an in-built feature, however it seems to have been marked off as bloat and wasn't included.

You could try and convince the development team to include it by posting in the Feature Requests board.. or perhaps asking someone to mod it for you.

Title: Re: Setting theme for custom pages
Post by: camealion on September 23, 2010, 12:57:00 PM
Thank you all for your replies and suggestions.  I did request this as a feature here (http://simpleportal.net/index.php?topic=6228.msg36321#msg36321).

I did find a way to work around what I wanted to achieve.  What I did is changed the links to the portal pages to include the theme I wanted to use.

For example:

     http://www.mydomain.com/index.php?page=page_1;theme=4    Would be one theme.
     http://www.mydomain.com/index.php?page=page_2;theme=5    Would be another theme.

The only issue that I had using this method is that the site will use what ever the last theme that was set.  So I have to tell my Home link to use the default theme.  I did that by changing the link in subs.php by adding  '?theme=3' after the $scripturl. ?theme=3 is what my default theme is set to.

So the code for my  home link look like:

subs.php
Code: [Select]
$buttons = array(
'home' => array(
'title' => $txt['home'],
'href' => $modSettings['sp_portal_mode'] == 3 && empty($context['disable_sp']) ? $modSettings['sp_standalone_url'] : $scripturl . '?theme=3',
'show' => true,
'sub_buttons' => array(
),
'is_last' => $context['right_to_left']
SimplePortal 2.3.8 © 2008-2024, SimplePortal