We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33160
    • 24 Posts
    Hello, I am coming from a joomla background and am trying to have a go at designing with modx.

    I want to know if there is a way to have a chunk (say a header animation/banner) to show when someone clicks on say the about us page and have another header chunk with a different image show when another menu item is accessed like services in the same spot? I want to know if its possible without creating multitemplates.
    This is achieved in the above mentioned cms by enabling/disabling the module for individual pages.


    This is currently what is keeping me from going live with the site now so any help or tips would be greatly appreciated.

    Thanks
      • 25483
      • 741 Posts
      Take a look at template variables! With that you can assign specific data to a page.
        with regards,

        Ronald Lokers
        'Front-end developer' @ h2o Media

        • 33160
        • 24 Posts
        Thanks mediaguy for the reply but how can i get a flash header/banner which i have already created into a TV? I have added it to a chunk and its showing perfectly but I have different headers that I want to appear on specific pages and cant seem to do that with chunks. Please how can i add the flash header created to a TV .

        Appreciate
          • 36693
          • 66 Posts
          You could create a TV, with a dropdown list of options and a default - used to specifiy which chunk should be shown on the page.
          Then create a snippet to pull in the correct chunk depending on the TV value of the page it is included in.

          I suggest this because you sound like you might have five options (for different areas of the site) shared between twenty pages.

          The other option would be to have a plain text TV, and then just include it into the page template at the header. You then set this for each page, but it would be different for each page i.e. you’d possibly have redundant copies. You could set a default again for common pages.

          I’m not sure which option MediaGuy was referring to.
            • 4172
            • 5,888 Posts
            There is no need for a snippet to do so:

            you can put in your optionvalues banner1=={{banner1_chunk}}||banner2=={{banner2_chunk}}||banner3=={{banner3_chunk}}

            and as default value: {{banner1_chunk}}
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 25483
              • 741 Posts
              Quote from: Bruno17 at Jun 12, 2009, 08:44 AM

              There is no need for a snippet to do so:

              you can put in your optionvalues banner1=={{banner1_chunk}}||banner2=={{banner2_chunk}}||banner3=={{banner3_chunk}}

              and as default value: {{banner1_chunk}}

              In this example you should use this as default value:

              @inherit {{banner1_chunk}}


              the @inherit will look up into the document tree to see if a upper document has the variable set. If that is so it will get that choice instead of the default.

              So for example this is your document structure:

              Home (TV set to banner2)
              About us (TV set to banner3)
              --the company (no TV set)
              --the people (TV set to banner2)
              Contact (TV set to banner1)


              In this example the sub document "the company" has the default value of the TV, because it inherits it’s parent the system tell’s to use the value that is set in the "About us" page instead of the default value.

              I hope this makes some things clear smiley Just post another question if you need more help!

                with regards,

                Ronald Lokers
                'Front-end developer' @ h2o Media

                • 36693
                • 66 Posts
                Quote from: Bruno17 at Jun 12, 2009, 08:44 AM

                There is no need for a snippet to do so:

                you can put in your optionvalues  banner1=={{banner1_chunk}}||banner2=={{banner2_chunk}}||banner3=={{banner3_chunk}}

                and as default value: {{banner1_chunk}}
                Wow. ModX just keeps surprising me with neat new tricks. This is truely neat.

                (Plus, it looks like my site could do with some optimisations!)
                  • 33160
                  • 24 Posts
                  wow, thanks all for the tips.

                  I am just reading your tips now so I will need clarifications then.

                  @Mediaguy

                  Let me try to create the TVs now. I will be asking you questions cause i have never created a TV before embarrassed . Was just doing chunks.

                    • 25483
                    • 741 Posts
                    There is some good information about TV’s on http://svn.modxcms.com/docs/display/MODx096/Template+Variables

                    Don’t forget to check the "Creating a Template Variable" page for some good information about the options that TV’s have wink
                      with regards,

                      Ronald Lokers
                      'Front-end developer' @ h2o Media

                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                        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