Different defaults for same PageTypes in different themes

Permalink
Hi,

sorry if this answer was already given.

I want to have same pagetype ( leftCol fe. ) and to use different defaults in different themes.

Is that possible to do, and how?

Thank you

 
MrGrowBizz replied on at Permalink Reply
MrGrowBizz
Not exactly sure by the description as to what you specifically want to accomplish, but thought this may help.

Take a look at my post at:
http://www.concrete5.org/community/forums/usage/hide-andquotsite-na...

This should work on any page(except some system pages)when the custom template is applied, and can be multiplied by adding additional custom templates with different designs by duplicating and renaming file involved. This approach is dependent on what theme is being used and possible conflicting new file names. I am a real hack and not an expert, but has worked for me.

Also taylormaai's reply in applying a different template to the login page:http://www.concrete5.org/community/forums/themes/customizing-login-... as it may also stir some thinking on what you are trying to do.

Hope this helps!
eOne replied on at Permalink Reply
thanx MrGrowBizz but that doesn't help.

I'll try to explain better:

I have two themes applied on my site ( _old_ and _new_ theme fe. )
They both have and use same PageType ( left_sidebar.php fe. )

Now, when site was designed, on PageTypes page we have defined some defaults for this left_sidebar.php and _old_ theme. Defaults is pretty good tool for layouting site.
Now, the problem is ... how to change defaults for left_sidebar.php for _new_ theme ?

It seems that pagetype defaults are used over all themes installed/active. That is kind of contra productive, as I should now create new left_sidebar_newTheme.php to set new defaults for different behaviour.

Maybe I am missing point of use here ?
MrGrowBizz replied on at Permalink Reply
MrGrowBizz
Oh...I think I understand. Your want the same page defaults you created for the old theme page in the new theme page. Basically want to copy the old (newly edited default page) into the new theme.

Unfortunately I have not been able to accomplish this task without rebuilding a new default page. Hopefully someone on the forum with a higher skill level than I can assist. I would also find it to be very useful.

If this can not be accomplished, possibly this post which jordanlev has commented on would helphttp://www.concrete5.org/community/forums/customizing_c5/default-bl...

I have not used his methods mentioned, and don't know if they can be applied across themes or possibly offer you a work-around if a direct solution is not found. Very Best!
eOne replied on at Permalink Reply
Should PageTypes defaults be customizable for each theme installed ?

I find this as something that should be part of concrete5 if not essential for whole "pagetype defaults" thing.
jordanlev replied on at Permalink Reply
jordanlev
I respectfully disagree -- I think the whole point of themes is that you can change the look of pages without affecting the content or underlying data.

I understand your desire to have this functionality, and unfortunately I don't think there's a way to do this easily (short of just having two different page types that happen to have the same markup), but I think your use case is the minority -- most people switch themes to get a different look of their site without having to change content or defaults or attributes etc.
eOne replied on at Permalink Reply
Thank you jordanlev.

Situation:
I am doing redesign of site and I wanted to keep pagetypes as they are. So I copy content and assign new theme to it.
The look will change a lot, but defaults of pages cannot be touched or it will mess with existing - old version - of site.

So, as far as I can see, I can create whole new set of pagetypes, ( that doesn't make sense later), or start working on new subodomain/site and copy content/themes back/forth.

As I work a lot with graphic design tools, I am customed with different approach to use of defaults/masterpages.
Did I miss a way that makes this easier/better to do ?
jordanlev replied on at Permalink Reply
jordanlev
Hmm... that is a tricky situation. You might be able to take advantage of an "interesting" behavior of c5 which is that if you change the names of areas in your templates, the old content does not disappear but instead just doesn't get displayed.

Before I show you what I'm thinking, please note that this is just a hypothesis and you should really test it all out on a development copy of the site, and not the live site (and even if it works and you go to deploy it to the live site, make sure you've backed up everything -- the files and the database -- before going ahead with it).

Okay, so what you might do is put some code like this around the various ares in your page type templates:
<?php
$themeHandle = $this->getThemeHandle();
if ($themeHandle == 'old_theme_handle' && !$c->isMasterCollection()) {
    $a = new Area('Old Area Name');
} else {
    $a = new Area('New Area Name');
}
$a->display($c);


What this code says is that if the old theme is being displayed and you're not on the "Page Defaults", then show the content in the old area. But if you're on any other theme (i.e. the new theme or anything else you change it to) OR if you're on the page defaults, then show the new content areas. Behind the scenes, the old content areas are still there in the database, so the defaults that were set for them should still hold -- but now when you edit the page defaults, you'll be setting them for new areas that don't get displayed in the old theme.

You'll need to modify that code to suit your exact needs of course, but hopefully this gets you going in the right direction.

Hope that helps!
eOne replied on at Permalink Reply
Nice thinking :)
I understand what you are talking about. I'll give it a try.

Tnx!