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

    I’m a noob. A designer noob at that. Just getting to grips with Modx and some of it is beginning to make sense, but I’m now fairly certain I’ve got the wrong end of the stick with the way I’m going about things. Here’s a tiny little site (2 pages) which is just a temporary holding thing but which I’m using as my first test Modx site. As it stands it is not created in Modx, but I am creating a mirror version of it using Modx: www.mint-clothing.com

    Here’s my stumbling block. As you’ll see, the default home page features a simple Flash slideshow. For those who don’t have Flash there is a near identical static page that is linked to from the bottom accordian panel link on the right-hand side of the page. What I’ve done is to create TVs for each of the accordian trigger headings and for each of the accordian panel contents (as html). So far, so good - I thought. I created a template for the Flash version of the page that contained all the necessary TVs, chunks and other stuff and all works fine. Then I thought I’d duplicate this template, remove the flash stuff and by so doing, create a static version of the page. And this is where it dawned on me that I reckon I’ve gone wrong in my use of TVs.

    The problem is that even though both the static and Flash versions of the page are using exactly the same TVs, I’ve realised that I will have to manually duplicate all of the content in each of the TVs for both pages, when what I really want is for both versions of the page to call exactly the same content for each of the TV fields - a bit like an SSI (which is probably what I’d do normally). The content in the accordian panels could be text, image(s) or a mix of both (see the ’contact us’ accordian panel for a good idea of the sort of thing I’m looking to achieve). The working intention is to later create a simple User/Editor role who can use the manager to simply update the accordian panels with a minimum of fuss and ideally no duplicated effort.

    And obviously, using Modx for a two page website is sledgehammer to crack nut territory,Iknow, but I’m simply using this as a starting point for a more complex undertaking as I get a better handle on Modx. Gotta start somewhere!

    Clearly, I’ve got my head up my arse with Modx’s modus operandi, so please could some kind soul point me to a more efficient solution.

    Many thanks.
      • 22019
      • 390 Posts
      I *think* this is what symlinks are for, isn’t it? You can present the same content using different templates and different aliases.

      Another way is to make one of the two resources a parent of the other, you can set the TVs in the child to @INHERIT the content from the parent.
        Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
        • 8173
        • 10 Posts
        Genius!
        Went for the parent/child @INHERIT approach and it worked like a dream.

        Thank you, odeclas.
          • 3749
          • 24,544 Posts
          There are few other ways to go as well:

          You can create an unpublished parent page with the value and all the children will inherit it.

          You can also set a default value for the TV as:

          @INHERIT somecontent


          where somecontent is the value you want to use. Then leave it blank in all the pages.

          Probably the best method, though is to put the content in chunks and set the default value of the TV to:
          @CHUNK chunkname


          In MODx, there’s almost never just one way to do what you want. wink
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 8173
            • 10 Posts
            Thank you for the further insights, Bob, much appreciated. I’d begun to understand that there is rarely any one best way of doing things in Modx, it’s just that at the time I didn’t know even one of them!

            As a point of interest; I had initially thought about using chunks for the accordian panel content, but dismissed it as my understanding was/is that the user (who in this case is not at all tech savvy) would need wysiwyg rich text editing which isn’t an option with chunks. Am I mistaken?

            As things have turned out, this has been really useful because now with a mix of the @inherit routine and placing default entry values in the TVs I’ve been able to get the best of bost features. Beginning to feel pleased with progress in Modx, I’ll stick with it and persevere [excuse mild tautology].

            Many thanks again.
              • 13736
              • 345 Posts
              It sounds like you got things working within your intended workflow, but here is a different way to think about building out your home page(s).

              For the home page you could create a template shell with just the common elements for both pages. Then for the content in the slideshow, create an unpublished folder (named slideshow?) and put a page for the slideshow image in there. Then use the getResource snippet to build an XML feed for the flash slideshow engine.

              To turn a slide on or off you just publish or unpublish the pages inside your slideshow folder. Plus, if the static page was for people on a mobile device that doesn’t support Flash you could use the same technique to create a javascript slideshow using something like jQuery with the Cycle plugin (or probably half a dozen other slideshow plugins)

              You could conceivably do that for any element on the home page and have the data pulled from the Content or TV fields on another page, but that seems like over kill for items that don’t rotate content.
                • 8173
                • 10 Posts
                Wowserooni!
                That’s what I call service! Thank you, Pixel Stuff and all other kind respondants, this is gold dust and won’t go to waste. Happy New Year and all the best for 2011.
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  I’ve written an article for some fancy TV and ManagerManager footwork for Evo http://sottwell.com/mm-tvs.html , you should be able to do something similar for Revo only better.
                    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
                    • 8173
                    • 10 Posts
                    That looks fabbo, Susan. I’ll certainly have a good looksee as even with my limited understanding of php (close to nil) I can see the potential here. Many thanks.
                      • 3749
                      • 24,544 Posts
                      Quote from: sottwell at Jan 03, 2011, 10:03 AM

                      I’ve written an article for some fancy TV and ManagerManager footwork for Evo http://sottwell.com/mm-tvs.html , you should be able to do something similar for Revo only better.

                      Very nice! I think the same thing could be done in Revo with "Create Tab," "Move TV to tab," and "Tab Visible" (these names might not be quite right) with a constraint to determine which pages it happened on. The only additional thing I can think of in Revo is that you could also make it sensitive to permissions (MM probably does that too).

                      I’m not sure, but think the tutorial would be more time-consuming to write in Revo because you’d have to document all the FC steps rather than just listing the MM rules.
                        Did I help you? Buy me a beer
                        Get my Book: MODX:The Official Guide
                        MODX info for everyone: http://bobsguides.com/modx.html
                        My MODX Extras
                        Bob's Guides is now hosted at A2 MODX Hosting