Does anyone know how to programmically change a theme in a module?
Once apon a time you could just set $theme = "themename"; but that does not appear to work any more.
Any ideas would be warmly welcomed
Thanks
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- rgasch created topic »Using PageUtil::addVar() to load script code« 11:48 AM
- michiel responded to »password problem« 10:01 AM
- mazdev responded to »Hide "Register new account" and change template to 3 col« 07:50 AM
- mesteele101 created topic »Zikula 1.3.3 - Site Search 1.5.2 - Unable to turn off plug-ins« 07:48 AM
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Programmically Change a Theme
-
- Rank: Registered User
- Registered: Apr 02, 2002
- Last visit: Dec 13, 2009
- Posts: 32
-
- Rank: Team Member
- Registered: Sep 06, 2006
- Last visit: May 09, 2010
- Posts: 2446
It still works, but you musy enable the "Let the users to switch the theme" in the Theme admin panel
--
- Mateo T. -
Mis principios... son mis fines -
- Rank: Registered User
- Registered: Apr 02, 2002
- Last visit: Dec 13, 2009
- Posts: 32
Thanks nestormateo,
Is there a way of changing the theme for a page without enabling the users to change their themes?
For example, a module where a particular user function uses the, say, SeaBreeze theme. But all other - default - functions use the system default.
I know you can also just place &theme=name in the URL as well. But that is not what I am after. It is visible to the end user.
There must be an easy way to assign/override the theme via code.
Essentially what I want to do is print out a packing slip and invoice for a semi-ecommerce module. I don't want to use the "Printer" theme because it is the wrong format. And I don't want to change it as it is a core theme and doing so will effect other modules that use it.
The other idea I had was looking at the domain.com/Printer redirect.... -
- Rank: Registered User
- Registered: Apr 02, 2002
- Last visit: Dec 13, 2009
- Posts: 32
Looking at the htmlpages module, there is an option to display the printable version
becomes
The insertion of the "Printer", uses the Printer theme.
Infact, all enabled themes can be used here in that format
Of course turning OFF short URLs gives from above
- http://domain.com/index.php?module=htmlpages&func=display&pid=1&theme=Printer
So this works.
BUT!!!!! It requires the theme to be written in the URL - not be programmically decided by in program logic.
There should be a function like themeengine::settheme("themename")! -
- Rank: Freshman
- Registered: Apr 18, 2006
- Last visit: Feb 28, 2010
- Posts: 68
Make a Modul-Specific Template .
Look here:http://community.zikula.org/index.php?module=Wiki&tag=TemplateOverridng
--
regards from germany
High Quality Postnuke + Zikula Themes -
- Rank: Registered User
- Registered: Apr 02, 2002
- Last visit: Dec 13, 2009
- Posts: 32
Ooooh! Very interesting.
However, this is a template override - not a full theme override. It will still use the existing theme and just change the template (ie the [!--[$content]--] part of the theme). I want to keep the template and change the theme.
The stylesheet option is a possibility, but again, that does not change the theme layout (ie. blocks, header, footer).
Nice idea though - thank you.
What I really need is to be able to set a given theme for a given function - maybe even selecting a from choice of themes.
We could do this once - all news of topic "News" was RedTheme - topic "Events" was BlueTheme. etc...
Maybe that is where I need to look... can it still be done in the new Categories modules??
The other thing I notice - completely on a tangent - is that the theme style sheets should come after the module style sheets. Since theme are the definitive end result.......
edited by: geoff, datetimebrief -
- Rank: Developer
- Registered: Mar 29, 2005
- Last visit: Mar 13, 2010
- Posts: 228
You can create different layouts within the same theme and assign them to different modules/sections. e.g. most theme have a home.htm for the homepage and a master.htm for the other pages, you can do the same thing for each module/function
Go to Layout -> themes -> edit -> page configuration
you can create as many different layout as you want
--
Zikula Italia
SimpleGallery -
- Rank: Team Member
- Registered: Sep 06, 2006
- Last visit: May 09, 2010
- Posts: 2446
I thought in the same way that Arthens
but that would imply to support different "styles" in the same theme.
Are you thinking on change the layout drastically to need a complete different theme?
I'll check the core code to see if there's such possibility
if not, we should have it for 1.3
--
- Mateo T. -
Mis principios... son mis fines
- Moderated by:
- Support
Users on-line
- 0 users
This list is based on users active over the last 60 minutes.
