We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28392
    • 2 Posts
    I´m seting up a webpage for a friend and i´m totaly new in MODX. I have one problem that I hope you could help me with smiley I have crated a own template and use a "chunks" to show information on my right side of the page, the chunk is called "page_sidebar". Can i do so that the chunks show diffrent information dependning on what page id it´s on?
      • 18453
      • 66 Posts
      You could give those pages other templates so you can call other chunks for those pages.
        • 18453
        • 66 Posts
        Or you could call the chuncks by using template variables, so you can change the chunks for those pages very easy.
          • 23571
          • 223 Posts
          You could also place PHx statements in your template to show chunks based on which document ID the user is viewing.

          http://wiki.modxcms.com/index.php/PHx
            • 18453
            • 66 Posts
            For example you have 2 chuncks one {{recentNews}} and an other {{iLoveModx}}.

            You can make a new TV (template variable) name it sideBar and select the template that you use to give it access to the TV and save it.

            And then put this code in your template [*sideBar*] where you want your sidebar to show.

            Now go to your site.com/manager and when you add a new page or edit a existing one.
            Scroll to the bottom, thats where you will find your sideBar input field.
            Now you can put in what chunk(s) you would like to display on that page {{recentNews}} or {{iLoveModx}}.

            I think this is a way to do it.. smiley
              • 28392
              • 2 Posts
              Quote from: martenh at Jan 21, 2010, 07:43 AM

              For example you have 2 chuncks one {{recentNews}} and an other {{iLoveModx}}.

              You can make a new TV (template variable) name it sideBar and select the template that you use to give it access to the TV and save it.

              And then put this code in your template [*sideBar*] where you want your sidebar to show.

              Now go to your site.com/manager and when you add a new page or edit a existing one.
              Scroll to the bottom, thats where you will find your sideBar input field.
              Now you can put in what chunk(s) you would like to display on that page {{recentNews}} or {{iLoveModx}}.

              I think this is a way to do it.. smiley


              Thanks!!!! It works wink