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
some more infos and code could be helpfull
-
☆ 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.
-
☆ 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.
Hey,
It was a bit of a learning curve for me but I figured it out.
-
☆ 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.