Adding Site-wide Sidebar Code


(Bruce Kieffer) #1

Is there a way to enter sidebar code site-wide? I’m using Endeavor theme, and the social icon code is placed in the Page sidebar section of the Inspector, and then the social icons appear in the footer. I want to do this once rather than have to add the code to every page in my project.


(Brad Halstead) #2

@bruce, I don’t have the theme, but I can guess by looking at the element inspector (Safari Dev Tools) that he is using a developer %macro% to use %sidecontent% to pull the content from the sidebar into the page at the footer.

To the best of my knowledge, there is no way to put this sidebar content site wide. I have tried to make it a txt file resource and pull it into sidebar with %resource(filename.txt)% but that fails, I have tried html file resource and pull it into sidebar with %resource(filename.html)%and that fails too but I cannot get the sidebar to recognize the resource macro without it being in an anchor or image link in the sidebar content area.

My thinking was to save you typing thats why the resource macro attempt.

You could just copy/paste it to each pages sidebar content area in the inspector once you have the site all configured page wise.

Other than that, you could duplicate the theme (Save the original!!), open dev tools from the inspector (enabled in the RW preferences I believe) and see if you can do something with the 'Footer" to make it site wide by removing the calls from the sidebar and replacing with your code. save the modified theme and use that for your site.

Lastly, contact the developer, perhaps he has a way to make it a snippet or use a special macro or other ideas. I’ve run into the same issue with some themes and opt out of using that method and using a stack or paragraph or something else to get it site wide.

All I can think of dude, sorry.

Brad


(Rob Beattie) #3

If you’re using Stacks 3 another way to do it would be use Joe Workman’s Houdini stack.

  1. Add a Houdini stack
  2. Set it to ‘sidebar’
  3. Pop an HTML stack inside it and add your code
  4. Save the lot as a partial
  5. Add it to every page

If you’re using the PlusKit plugin from Loghound

  1. Create a page with a single HTML stack for your code
  2. Give the page a name but make sure it doesn’t show in the menu
  3. Wherever you want the code to appear in a Sidebar bring it in using the @import command built into PlusKit.

There are probably other ways as well.

Rob


(Bruce Kieffer) #4

I have used copy and paste, or duplicated pages to add the code to all the pages, but I am concerned about the need to make a change down the road, and the work involved in updating the code on every page. @robbeattie suggestion may be a solution to that concern. I will contact the theme developer and see what they can offer as a solution.


(Brad Halstead) #5

@robbeattie, how the heck did I miss that!? Of all the Stacks and everything I purchased through the Holidays, I missed Houdini but have it as a liked stack on the RapidWeaver Community site (go figure)… next purchase for this exact reason!

Thanks for bringing it back to my attention…

Brad


(Brad Halstead) #6

@bruce, will work exactly as you desire especially if you use it as a partial on each page :wink:

Brad


(Robert Ziebol 🖖🏼) #7

This should be said, that this solution will ONLY work on Stacks pages.


(Bruce Kieffer) #8

I found a solution using Useful Stack which I already have. I used the Partial suggestion. Seems to do the trick. Now when I make a change to the social icons, it will be global to all of my stacks pages. Great! Thanks.


(Richard Nicholls) #9

It’s probably not the best way of doing it but I pasted the social code html into Prefix area of the site-wide code with the Endeavor theme and it seems ok.


(Bruce Kieffer) #10

I don’t know why this worked, but I took the social code HTML stack out of the Useful stack and just place it on my page, not in the sidebar, and it worked. Then I created a partial of that and placed it on all of my pages. All works fine.