We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19909
    • 49 Posts
    Hi,

    I am getting stuck into Revolution as I can now see that at RC3 - soon it will be ready for public consumption smiley

    However, one notable omission from modx seems to be a simple way to change a sites theme across all pages in one easy step. I may be missing something obvious here but what I would like to know how to do if possible is to create a set of themes (not page styles) that I could switch between at the flick of a switch or dropdown menu?

    Does this kind of function require a module to achieve and if so is there anything readily available ?

    Any ideas would be greatly received,

    Regards,

    mmuller
      • 27708 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
        • 19909
        • 49 Posts
        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
          • 19909
          • 49 Posts
          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
            • 17499 ☆ 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.
              • 19909
              • 49 Posts
              Quote from: lossendae at Jul 19, 2010, 07:29 AM

              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.

              Lossendae,

              I agree that this is a possibility, however the main idea is that the overall look of the site should be global - then the TV can be used to drive the page layout for each page within a modx site. ie. choosing three column + banner. or one column + sidebar...

              I encourage all developers of modx to really take a look at concrete5’s implementation - if modx was like that then cms nirvana would have been reached!

              At the moment the theme is page independent and too abstracted from the ’site’ as a whole. ie. Home - could use either ’base template’ or xyz tv, and then: About - could use ’myTemplateOne’ or TV abc...

                • 17499 ☆ 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.
                  • 19909
                  • 49 Posts
                  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
                    • 17499 ☆ A M B ☆
                    • 872 Posts
                      • 20413
                      • 2,877 Posts
                        @hawproductions | http://mrhaw.com/

                        Infograph: MODX Advanced Install in 7 steps:
                        http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                        Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                        http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower