1

I am working on a product page where I want to give the option to the user to select between which sections they want to use eg banner section, description section, video section etc.

Now since the product pages might have some differences between them eg the description section on one product contains an extra image and an extra video I figured out that I can use a matrix field that contains a super table (plugin that allows matrix field within a matrix field) and another matrix field. By doing that I give the user the option to select the content they want to use within the sections.

enter image description here Am I overcomplicating things here and is there a cleaner way of achieving the same logic?

  • It would be helpful to see a screenshot. Generally, I prefer to avoid using 3rd party plugins for adding this kind of functionality, since it's not sure they'll be available/supported in the future. – 4midori Dec 12 '19 at 21:31
  • I ve just added an image. Since the product pages do not have the exact same layout I was looking for a way 1. to be able to move content around and 2. to give the users the ability to build it themselves. Does that make sense? – Argy Dec 13 '19 at 12:33
1

I see what you're asking. Instead of using SuperTable, you could create a block type that has two rich text fields in it, Column 1 and Column 2. Alternately, you can create a separate channel for repeating content types (a CTA, for example) and make a block type that simply relates to that content (block type is 'entries').

  • That would have been the solution if the user could select those options himself. Because i havent find a way to visually give them the option to select what they want to use. Remember, the product pages doesn't have the same design/structure between them. – Argy Dec 16 '19 at 10:25
  • Another possibility would be giving the user a different entry type based on layout options. – 4midori Dec 16 '19 at 17:02
  • I think the best way i found so far is either using a plugin called Neo or Supertable. On Craft 4 both are going to be use natively rather as a plugin so it seems quite a safe option. Thanks for your time regardless. – Argy Dec 18 '19 at 12:54
1

After further research, i got to the same answer. I can either use the plugin called Neo or Supertables. It has also being mentioned that they will both get moved as native functionality in craft 4. https://github.com/craftcms/cms/issues/812#issuecomment-516975780

Both accomplish the same thing, although even if Neo is more popular I found Supertables better for my case since they can provide an extra level of nesting. That means that I can select option from a field and then in the following field have further options to select from and position them accordingly. You can see a preview on the image I have uploaded initially.

  • Cool! I didn't know those would be migrated. Once my client finds out about Supertables...more work for me, maybe. But can clients handle The Matrix? Blue Pill, Red Pill, etc... – 4midori Dec 19 '19 at 16:29
  • Depends what kind of access you want to give them. In the project i am working on the client has only access to the entries and they are not allowed to change the matrix fields (mostly cause if they change a field type data will get lost). Thats why i am trying to create as many options as possible for them to choose between when it comes to build the pages. Hope that helps. – Argy Jan 9 at 10:09

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.