0

Sites design uses Bootstrap/jQuery tabs in content area.

Content inside the tabs is set up as Grid (image file, description, link etc).

Any ideas how to make creating/adding tabs dynamic?

Grid inside Grid would be nice :) Maybe plaintext field in each Grid row with tab name + some clever templating to group rows with same “tab name”? Not so elegant..


Take a look http://ford.co.uk/Cars/Ka/Design#primaryTabs

Similar tabbed content as this page (Inerior/Wheels/etc).

All content is entered in the Grid filetype (image file, description, link etc). I could define 3 separate Channel Fields with Grid filetype, one for Tab1 content, second for Tab2 content, third for Tab3 content. But problem is, I don’t know (its up to editors choice) how many Tabs there will be. Also I don’t want to clutter content editors view with unnecessary fields.

As i said, it would be easy with nested Grid (for each tab a row, whitch then contains content)..

Is there some clever way to achieve this?

  • You need to expand on your question to make it clearer what it is you're trying to do. The question "Any ideas how to make creating/adding tabs dynamic" is ambiguous. – foamcow May 6 '14 at 10:16
  • Take a look ford.co.uk/Cars/Ka/Design#primaryTabs Similar tabbed content as this page (Inerior/Wheels/etc). How do you set up channel fields, if you don't know how many tabs will be in each content page, but you know what kind of content inside the tabs will be? – user3058 May 6 '14 at 13:29
  • You don't need to know how many tabs there are. You would simply loop through all rows creating the tab markup for each. If they need unique IDs then you could append the {count} value to the ID for each. – foamcow May 6 '14 at 16:19
1

From the additional comments it seems you don't know how many tabs will be output.

This isn't a problem as you would simply loop through each row and create a tab for each. By using the {count} variable it is possible append a unique value to an id or class attribute.

Do you have any existing template code?

| improve this answer | |
  • Sorry, I’m poor explainer, added more explanations to original question. Thanks – user3058 May 6 '14 at 17:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.