-
MODX Staff
- 2,502 Posts
Are you asking about changing the site’s default template or batch changing templates across the site? If the former you can set this in system settings. If this is the latter you’ll want to install Batcher (a batch resource editor and manager) which will let you make changes across resources on a number of options.
You can install Batcher through the Package Manager.
Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup
magician.
Blog ✦
Twitter ✦
LinkedIn ✦
GitHub
smashingred,
It sounds like a start, but the idea or functionality I am aiming for is that a user of the CMS would be able to happily go about their business adding pages using say four different page templates from the current design.
Then, if they tire of the design - go to a page within the manager that would allow them to choose another theme (which would have the same page templates to save the system from breaking). Almost like the Wordpress theming manner of doing things.
I think that asking them to change the page templates each time would be too much for some of my expected audience !
Another Idea, would it be possible to have a plugin/module that would allow to select a css file (styling) to be used? This could also have an accompanying thumbnail image to display the basic styling of the css file - this way you could create page templates that adhere to a common structure (aka 960 for example) and then use the module to deliver the css file to the site...
Is there any documentation for plugins on revo somewhere? I have dabbled with modules on evo and might look into this at some point - unless anyone else is up for a challenge??
Regards,
mmuller
In fact, looking at batcher smashingred, I think that it would be quite simple to alter the codebase into a much simpler sitewide theme switcher.
Template designers could still use their desired naming conventions as long as they kept them the same across any of their themes and they could create html/php functionality templates that could use simple switches to the code output based on TV’s to drive the layout provided in the theme ?
Take a look at concrete5’s wonderful page layout selection and theming functionality for how modx would become the hands down best cms to develop with if this kind of facility was built in...
mm
-
☆ A M B ☆
- 872 Posts
The necessary UI fro your customer can be provided with the help of template variable.
You create a drodown TV with each theme name in a separated List.
You create all the related theme.
Then you can use a snippet to get your desired theme like this [[!MyTheme? &name=`[[*myThemeSelectorTv]]`]] which will become [[myTheme? name=`myTvValue`]].
Obviously there are probably more clever approach to your issue. I did see other solution on the forum but unfortunately, i did not bookmark the topics links.
-
☆ A M B ☆
- 872 Posts
That’s exactly my point.
TVs are what you do about them. I don’t really want MODx to have a more specific way of dealing with template since actually it’s flexible enough to be adapted to any desired case.
In MODx Revolution, the first dropdown field is the actual template selector.
Let’s say that I have 3 templates:
- First theme
- Second Theme
- Third Theme
For each template, i can provide specific TV to control the layout more specifically:
- First Theme -> with or without columns
- Second Theme -> with 2,3 or 4 columns
- Third -> with the same TVs as the first theme + 3 columns layout
It’s relatively easy to cut a template in several chunks to control your layout the way you want and provide an easy UI for your customer.
What’s missing for now, is some good tutorials to explain how to acheive this kind of behaviour.
But it’s available now.
Naming specifically the fields/chunks (sidebar, banner, footer, etc..) is up to you.
That’s what i like about MODx, it works the way I want not the way it thinks template should works.
Modifying the template to provide built in control over the layout will enforce the way of working with the CMS. And if someone want a specific template scenario, he would have to override the default behaviour (or hack the core).
That’s not the philosophy behind MODx. At least not from point of view.
lossendae,
I agree whole heartedly in a given situation where a client only requires one ’visual design’ to a website and then wants to control layout and item placement.
But, I am looking at offering this as a solution to various community groups - ideally they would all have a bespoke design built for them but as money is due to be a huge limitation to them I was hoping to derive a solution whereby I could prime the CMS with say 6 different designs of site each with 3 page layouts in. The user could then use the manager to upload their logo for the community group and then choose a site style from those available.
However, as each page would be capable of selecting a different design the aesthetic of the sites would be blown to pieces quite quickly - remember you have to think of the lowest common denominator when designing functionality like this - and some of the people wouldn’t understand why the site looked dififerent from page A to page B ( not layout, just the actual look and images used within the layout )
What I think I need to do is use Custom Manager? to remove the page template from the page editor and create a plugin that would then create a
<link rel="stylesheet" type="text/css" href="choosenStyle.css" />
that would drive the visual look of the site across all pages.
Then, I could use TV’s to allow the client the option of choosing page layouts and items to be displayed.
I don’t see this as changing the functionality of the base install - in that it could be made to default to the standard behaviour unless physically changed...
regards,
mm