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

Answered Dynamic Template

    • 38351
    • 16 Posts
    In MODX Revo, is there such a thing as a 'configurable template?'

    In other words, could I create a template such that a user in the Manager could select a certain base template, then within that one template, choose how many and what kind of chunks they want to see assembled on the page?

    For instance:

    • Configuration 1: A header, followed by two rows of full-width text areas
    • Configuration 2: A header, followed by one row of full-width text, then one row of two columns, each of those with an image
    • ...

    I feel like there would be a way to set that up using TVs and Chunks, but I'm not sure how.

    The obvious question is, why wouldn't I just create multiple templates and then just switch templates? I can certainly do that, but I was hoping there would be a more 'dynamic' way so that I don't have to prescribe a set of templates. Rather, the templates get 'designed' by the moderator based on their needs at that time.

    This question has been answered by mmcgee. See the first response.

      • 19872
      • 1,078 Posts
      Not sure that this is the best method, but you could use TV selectors.

      For example, create 3 chunks. One for a single column layout, one of a 2 column, and one for a 3 column. You could then create a TV with 3 check boxes which would call up the chunk the user or you want to use.

      I guess the thing to keep in mind would be that your content TV and other TVs are duped in each of the layouts somehow such that you don't lose content when switching from one chunk selection to another.
      • discuss.answer
        • 19872
        • 1,078 Posts
        You could also check out contentBlocks from modMore. It's a paid extra. Haven't tried it yet, but I have just recently started using moreGallery, and it's excellent. As well, I only use Redactor for my text editor in sites because I can create my own custom styles that can be applied via the editor in the resource manager.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          I'll second ContentBlocks.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 4172
            • 5,888 Posts
            ContentBlocks is the best option for this.
            Its possible to set something up with MIGX, too.
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 38351
              • 16 Posts
              Thanks guys, great stuff!