Basically I want to have a fixed sided bar with projects (CMS powered and scrollable when overflowing) and next to it the selected project
I’m currently struggling getting this done. I tried with CMS powered tabs (by Finsweet) but then I wouldn’t get a URL for each project and also I couldn’t make the tabs scroll when overflowing its container.
I also tried by copying the side bar to the cms template pages but then I can’t figure out how I can have a selected state for the current project in the side bar.
Would be great if anyone has a good insight on how to best approach this.
The URL changing, which you can also see in the proto-site is a bit trickier and requires a bit of scripting. I took the cleanest approach which is to use a hash to identify the selected tag, rather than a path part e.g. /tab-1.
The CodePen with that script is below, you just put it in the </body> of your page. Click the JS tab, there’s nothing to run there.
Important though, this is based on a non-CMS tab setup, which means the tab name ( text ) is currently the only identifier I have. I haven’t used Finsweet’s CMS tabs, however ideally you want to get the slug of your CMS item into the tab markup, because it’s unique and perfect for your hash. It will have no spaces and be all lowercase like my-cool-artwork.