setThemeByPath Dynamic?
Permalink 1 user found helpful
Hiii..
i try to figure out how to make setThemeByPath dynamic.
for now i just harcoded it in site_theme_paths.php
the problem is when we change default theme via dashboard, this not change
how we can know the default current theme?
where is the c5 query loaded the default theme? i cannot find it
thanks.
i try to figure out how to make setThemeByPath dynamic.
for now i just harcoded it in site_theme_paths.php
$default = 'yogurt'; $v = View::getInstance(); $v->setThemeByPath('/login', $default); $v->setThemeByPath('/page_forbidden', $default); ...
the problem is when we change default theme via dashboard, this not change
how we can know the default current theme?
where is the c5 query loaded the default theme? i cannot find it
thanks.
Scottc you are really a rockstar, the legend, the myth, etc :)
thanks a lot dude
this the first time i see that code :)
thanks a lot dude
this the first time i see that code :)
The myth? Hey i'm around ;)
-scott
-scott
This is really helpful. Mind if I wrap this up in a howto?
I don't see why not, this is pretty straightforward.
Just give me credit or something in it somewhere, referencing this post?
Just give me credit or something in it somewhere, referencing this post?
Hi - I'm trying to use this method to set my themes for different sections within my site. I'm not having such great luck; it seems to work fine for single pages, but doesn't cascade down through the structure of my site.
For example, I have:
$p = Page::getByID(HOME_CID);
$theme = $p->getCollectionThemeObject();
$default = $theme->getThemeHandle();
$v = View::getInstance();
$v->setThemeByPath('/esoc', "ESOC");
$v->setThemeByPath('/limnology', "CIRES");
$v->setThemeByPath('/eo', "ESOC");
I want the theme ESOC to be allowed to the /esoc/ directory and everything within it. However, when I add the trailing slash behind 'esoc' it doesn't work. If I remove the trailing slash, it works only for the page /esoc/ but no subsequent pages beneath it.
Do you know of a way to make this cascade down for everything starting at /esoc/ and all its subpages?
Thanks for any help you can provide!
-Kiki
For example, I have:
$p = Page::getByID(HOME_CID);
$theme = $p->getCollectionThemeObject();
$default = $theme->getThemeHandle();
$v = View::getInstance();
$v->setThemeByPath('/esoc', "ESOC");
$v->setThemeByPath('/limnology', "CIRES");
$v->setThemeByPath('/eo', "ESOC");
I want the theme ESOC to be allowed to the /esoc/ directory and everything within it. However, when I add the trailing slash behind 'esoc' it doesn't work. If I remove the trailing slash, it works only for the page /esoc/ but no subsequent pages beneath it.
Do you know of a way to make this cascade down for everything starting at /esoc/ and all its subpages?
Thanks for any help you can provide!
-Kiki