3

I'm setting up a site with several channels, and the design requires an introductory paragraph at the top of each channel's index page (ie. before the list of entries) - essentially a post that corresponds to the channel's index page.

As I understand it, there's only a template but no entry corresponding to the index of a channel, so I'm wondering how best to handle this in Craft. I definitely don't want it hard-coded in the template, and ideally it should be somewhere reasonably intuitive for site admins to find and edit.

It feels like it should be straightforward to implement, but I just can't quite think how to do it. Any suggestions would be much appreciated!

7
  • Not an answer, just an idea: perhaps it could work with a corresponding single section for every channel section. – MISC Jul 28 '14 at 14:10
  • Possible duplicate... craftcms.stackexchange.com/questions/1302/… – Lindsey D Jul 28 '14 at 14:22
  • Lindsey, it's similar but the wording for this one is easier to understand than the other post. – Jason McCallister Jul 28 '14 at 15:31
  • @Jason and now? Close the other one? ;) – carlcs Jul 28 '14 at 15:55
  • @LindseyD is right: this is a duplicate. I missed the original because it didn't mention channels (and it's a problem specific to channels, not sections generally). I submitted a small edit to the wording of the original question to make it clearer, but maybe the best thing would actually be to just give the other post the exact title of my one (which I think is much clearer) and then close this one as a duplicate? – Nick F Jul 28 '14 at 16:14
2

I'd recommend to either give each channel's index page a dedicated single section or you configure a structure section to contain them all. An advantage of using a structure over separate singles is that you can generate the site's main navigation from it. And you can add a hierarchy to it.

The structure settings in the CP:

URL for Top-Level Entries:
{slug}

URL for Nested Entries:
{parent.uri}/{slug}

You probably want to give your index pages individual templates. To do this just add multiple entry types to your structure and relate each entry type with a template as described in the FAQs.

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.