2

I have a site that's mostly 'static' content pages, with a few dynamic & more complicated pages mixed in. To make editing & setting up the navigation easy, I started by creating a Structure that holds all the entries in my Pages section. Let's say that structure looks something like this -

  • About
    • People
    • History
  • Products
    • Product A
    • Product B

It's more complicated, but just a longer version of that. This structure is used to generate my navigation for the site, and everything is working as expected.

Now, all my content pages are in place and I need to add the 1-offs. The first is a contact page, which is going to live @ /about/contact. I'd like to place it within the structure because otherwise my navigation becomes a lot more complicated.

The problem is, it draws from a different template than my normal content pages, and a structure can only pull from a single template regardless of what sections are listed in it. Ok, I thought, I could put the entry into that structure and then use a route to direct that page to the template I want to use. That doesn't work, however, because page URI's are processed before routes.

So, the question is - what am I missing about doing this? Is there a better way to set up what I'm doing?

2 Answers 2

4

Assuming that those pages are working off of different entry types, you should check out this great help article...

How can I give each Entry Type its own template?

Basically, you let a parent template decide which child template to load, based on the current entry type.

1

Entry types is probably the way to go but you could also check advanced routing - http://buildwithcraft.com/docs/routing#advanced-routing

Your Answer

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

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