2

I'm trying to build a page similar to the index page of buildwithcraft.com. There you have a page with (visual) sections ("A new kind of flexible", "Ready where you are" and so on). Each one has different backgrounds and maybe different layouts as well. Therefore you need a different set of input fields for every such section.

What's the best way to set up a (craft) section that allows you to edit pages like that?

2 Answers 2

3

I would use a matrix field with multiple types.

2
  • That's a solution, yes. But the disadvantages I see there are: 1) You need one field type for every layout + all need a name. 2) I need to edit a field (the matrix field) everytime I want to add a layout. But it's the most convenient way I guess. I was also thinking about structures and channels.. Commented Aug 9, 2014 at 20:04
  • I would pick structures over channels because of the reordering option. You would need to add an entry type instead of a matrix type for a new layout, which is more hassle, but also more flexible - more field types possible in an entry type than in a matrix type. Commented Aug 9, 2014 at 21:26
1

I've done something similar with custom includes. Make a new section called 'includes' with a matrix to build content and options for background colour, text colour etc. Then from your 'home' page (or whatever page) have an 'entries' field that links to those includes.

An added benefit of this method is that you can use these sections on multiple pages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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