1

I am looking for suggestion on how to setup a resource section on a site I'm building. Here is the structure.

Resources - Index

Entry type of resources Webinars -Webinar Entry (template for a single webinar) -Webinar Index (all webinars) Whitepapers -Whitepaper Entry (template for a single whitepaper) -Whitepaper Index (all whitepapers) Ebooks -Ebook Entry (template for a single ebook) -Ebook Index (all ebooks)

I was originally thinking to this as a channel, but how to I create indexes for the entry types: webinars, whitepapers, and ebooks?

2

The way I've done this in previously is in your templates have a directory titled Resources and inside that directory another directory titled _types

Within the _types directory I will have the code to output the content based on the entry type. I would name each of those templates ENTRY-TYPE-HANDLE.html

The on your Resources index user the following: {% include "resources/_types/" ~ entry.type %}

  • How to you handle index page for those entry types? – Danielle Frappier Apr 5 '18 at 14:57
  • I actually think I figured out a way to make the index template. I just used the routing so for the route resources/webinars I pointed it to an index template for webinars. – Danielle Frappier Apr 5 '18 at 19:36
  • @DanielleFrappier Just name your index templates the same as the entry type name, e.g: whitepaper.twig – Seth Warburton Apr 6 '18 at 8:18

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.