Has anyone developed a tabbed content template where if, say you have five tabs but you want to remove the third tab and its contents?
Currently the example tabs template (for download) in the squiz community website has a dropdown which gives you the ability to create a maximum of 5 tabs. This adds/removes tabs at the end. For anyone considering using this template and for it to be viable for production it needs to be more flexibility to remove/hide any visible tab particularly in large organisations where content changes frequently.
Ok, looks like none one wants to add to this post but I have bee trying to do the following.
For some reason the same code which shows hides tabs doesn’t work in Matrix. In the meantime If I do find a solution I will post my final project for others to use
Thanks Bart, yes I did. I’ve crated accordions, tabs and other templates but never used them in production because I don’t think they’re intuative enough for the average user.
You’re going to get someone who wants to delete / remove (lets say you have 5 tabs) tab 2 and 3.
I just know users are going to ask how do I remove tab x y only
The issue is Matrix CCT doesn’t keep track of what tab was removed, if there are 5 tabs and you remove tab 2, Matrix only knows that one tab was removed but not exactly which one.
I’m trying to create another metadata field tab-1.active and so on as checkboxes - closing say tab 2 and 3 checks those checkboxes then keeps their state to checked so my theory is only show tabs that have a checkbox that is eqaul to false
Am I on the right track? I do believe the matrix community would benefit from using CC templates more so if the above was resolved
We use dynamic tabs and accordions throughout our sites. The content lives as pages in a folder and the container template uses that as a source. Essentially its a stylised asset listing. To turn on/off content just means changing the status of the page.
Thanks Edward - yeah that’s how we do it also.
The CCT is better though as it uses metadata to store content rather than having potentially hundreds even thousands of standard pages as assets within your site - makes it harder not index these pages and especially if you have to do an audit on your site i.e remapping to a new IA
Version 1
Was completely revised by a senior squiz implementor to my original concept.
This version allows you to add and delete any tab. Adding a new tab is alway added at the end but you cannot reorder any of the tabs. Tabs are based on bootstrap but you can obviously change to whatever your preferred choice is.
I’m adding/sharing these in the hope that others can benefit and learn when implementing any CCT’s.
version 2 is a work in progress but I encourage others to download and make improvements (for those who have strong javascript skills) but must share their work here so we can all benefit.