2

I'd like to create some tabs on a page, and the content inside each tab. The thing is, inside one tab you will have 3 columns which would have a title/body in little sections for each column. Then in another tab you'll have a masonry list so a title and then a bunch of spans repeated. Another tab might be a body field and an image.

So you can see there is repeating content inside each tab and you can't have a matrix in a matrix as far as I can see.

How would those more experienced approach it? Am I overthinking it? I'd like something that is easy for the customer (of course!).

Updated with diagram and what I had in mind.

Inside Craft

  • Do the tabs need to be defined on a per-entry basis, or will they be consistent for each entry? – Brandon Kelly Oct 18 '14 at 10:03
  • They will be dynamic, so on a per entry basis. It is sort of 2 problems in 1. How to do the tabs and then the column layouts I suppose. But the entry of content should be logical. – Ryan Oct 18 '14 at 15:32
  • Do the tabs needs to be the same entry? Could you perhaps use structures, with a unique entry for each tab (with their own entry type), that extend a base 'tab' template, and grouped by the parent entry in the structure heirarchy? – Douglas McDonald Oct 18 '14 at 16:15
  • Just added an image of the layout, and the structure idea. – Ryan Oct 19 '14 at 2:02
2

This really is a case for nested Matrix fields. It’s something we definitely plan on adding at some point, but that won’t help you here.

Looks like you’re using nested Structure entries to accomplish it right now – that’s probably your best bet for the time being.

  • Yeah it implements fine and is easy to visualise for the customer but the additional fields are a little confusing for them. – Ryan Oct 22 '14 at 1:58
1

As Brandon mentioned in 2014, this is a good case for Matrix-within-a-Matrix. Until that functionality gets added into core, the following two plugins are your best bet:

  1. Neo plugin
    https://github.com/benjamminf/craft-neo
    Provides the ability to place existing Craft fields inside a matrix, group fields into tabs, and also nest blocks as "children" of other blocks.

  2. Super Table plugin
    https://github.com/engram-design/SuperTable
    Allows you to create repeatable fields that include almost any field type, including matrix.

This wiki page from the Neo repository also lists a few videos and other resources which delve into this topic:
https://github.com/benjamminf/craft-neo/wiki/6.-Resources

(Taken from my previous answer at https://craftcms.stackexchange.com/a/16203/5437)

0

Maybe I just don't understand what you're trying to do, but can't you use one dedicated Matrix field for each of your tabs? All in a single entry "Agency Structure"?

If you want you can group fields using "CP tabs" in the field layout manager. You could do one tab for each of your tabs and an additional one for the main content / slider.

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.