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

    I have created a sidebar on my site using a template variable which has a set default value, the template variable has been applied to my page template. Each page within my site that shares the template variable requires minor changes to the sidebar menu items, I am able to do this on a per page basis via the template variable tab. However the issue that I have is with the static menu items, I want to be able to change the default value within the tempalte variable and have it applied site wide.

    Is this possible , if not is there an alternative method I should be considering ?

    Thanks,
    Michael
      • 45929
      • 16 Posts
      bump
        • 4172
        • 5,888 Posts
        some more infos and code could be helpfull
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          I use the "Asides" extra. This gives you a custom TV with a checkbox list of chunks that are in a given category. Each chunk is a block of content for the sidebar. You can drag-and-drop the list to re-order the chunks as you wish, and select only the chunks you want for each page.

          The chunks, as is usual for chunks, can contain any HTML or MODX tags, so they could contain regular TVs for similar blocks that need to be customized for each page. Blocks that would be the same for all pages would use snippets or however the block needs to be generated.
            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
            • 3109 ☆ A M B ☆
            • 894 Posts
            If you want to have a global variable you should use a ContextSetting or SystemSetting then you can use something like ClientConfig to change it in the manager.
              Benjamin Marte
              Interactive Media Developer
              Follow Me on Twitter | Visit my site | Learn MODX
              • 45929
              • 16 Posts
              Quote from: sottwell at Feb 26, 2014, 07:12 AM
              I use the "Asides" extra. This gives you a custom TV with a checkbox list of chunks that are in a given category. Each chunk is a block of content for the sidebar. You can drag-and-drop the list to re-order the chunks as you wish, and select only the chunks you want for each page.

              The chunks, as is usual for chunks, can contain any HTML or MODX tags, so they could contain regular TVs for similar blocks that need to be customized for each page. Blocks that would be the same for all pages would use snippets or however the block needs to be generated.


              Hi Sottwell,

              Thanks for the suggestion, could you possibly elaborate on how I setup the aside properly?

              My sidebar consists of the following:

              <div id="secondary"><!--begin secondary-->
                <ul id="sidebar" class="page"><!--begin sidebar-->
                  <li class="featured">
                  	<h4><a href="[[~21]]">0</a></h4>
                  </li>
                    <li><span><a href="[[~17]]">1</a></span></li>
                    <li><span><a href="[[~20]]">2</a></span></li>
                    <li><span><a href="[[~18]]">3</a></span></li>
                    <li><span><a href="[[~15]]">4</a></span></li>
                </ul><!--end sidebar-->
               
                <ul id="sidebar" class="brochure"><!--begin sidebar-->
                  <li class="featured">
                  	<h4><a href="#">5</a></h4>
                  </li>
                  <li><span><a href="#">6</a></span></li>
                </ul><!--end sidebar-->
              
                <ul id="sidebar" class="video"><!--begin sidebar-->
                  <li class="featured">
                  	<h4><a href="#">7</a></h4>
                  </li>
                  <li><span><a href="#">8</a></span></li>
                </ul><!--end sidebar-->
              
                <ul id="sidebar" class="page"><!--begin sidebar-->
                  <li class="featured">
                  	<h4><a href="#">9</a></h4>
                  </li>
                  <li><span><a href="#">10</a></span></li>
                </ul><!--end sidebar-->
              </div><!--end secondary-->
              <br class="clear" />
              
              


              I need to setup up slight variations of this per page. [ed. note: michael.hayes last edited this post 12 years, 7 months ago.]
                • 45929
                • 16 Posts
                Hey,

                It was a bit of a learning curve for me but I figured it out.
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  For one thing, you can only have one element on a page with any given ID, such as id="sidebar". If you have multiple elements that you want to have the same selector key use classes instead, class="sidebar".

                  Create a category "Sidebar". Put each of your UL blocks into its own chunk, and put the chunks into the Sidebar category. Follow the installation instructions for Asides, using the ID of the Sidebar category.
                    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