We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Help me decide: multiple template groups and channels or not?

How Do I?

USC Chan's avatar
USC Chan
81 posts
3 years ago
USC Chan's avatar USC Chan

Something else to consider as you have more routes is making sure that the one you want is triggered. The more specific you make the URLs, the easier that is. That’s why:

/show/{name-of-show:alpha_dash}/ep/{name-of-episode:alpha_dash}

is better than

/show/{name-of-show:alpha_dash}/{name-of-episode:alpha_dash}

For example, if/when you have characters as well, you’d want to avoid something like:

/show/{name-of-show:alpha_dash}/{name-of-episode:alpha_dash}
/show/{name-of-show:alpha_dash}/{name-of-character:alpha_dash}

which would create ambiguous URLs. Better to have something like:

/show/{name-of-show:alpha_dash}/ep/{name-of-episode:alpha_dash}
/show/{name-of-show:alpha_dash}/ch/{name-of-character:alpha_dash}

Also, it can help to avoid inadvertent mtatches if you put the more specific template routes first in the list (Developer > Templates > Template Routes):

/show/{name-of-show:alpha_dash}/ep/{name-of-episode:alpha_dash}
/show/{name-of-show:alpha_dash}/ch/{name-of-character:alpha_dash}
/show/{name-of-show:alpha_dash}
? 1
       
Linda A's avatar
Linda A
666 posts
3 years ago
Linda A's avatar Linda A

Thanks Paul, that made it a lot clearer. I agree on keeping the name of the show in the url for clarity and to keep the structure the same, though I think I will go back to abbreviating the show names to shorten the urls somewhat.

One point that still confuses me a little is whether using a url like /show/{name-of-show:alpha_dash}/ep/{name-of-episode:alpha_dash} would ensure that any episode displayed actually is from the show in question…though I suppose there isn’t any real risk of a url being generated that somehow mixes it up. With characters I will need to include some kind of suffix for a few since there will be a couple of reused names.

I’ll give the new examples a try and hopefully get this together. 😊

       
USC Chan's avatar
USC Chan
81 posts
3 years ago
USC Chan's avatar USC Chan

> One point that still confuses me a little is whether using a url like /show/{name-of-show:alpha_dash}/ep/{name-of-episode:alpha_dash} would ensure that any episode displayed actually is from the show in question…though I suppose there isn’t any real risk of a url being generated that somehow mixes it up.

Right. If all of your episodes are in the same channel, because the URL titles have to be unique there wouldn’t be any chance of getting the wrong show.

FWIW, in theory your episode template could also work in the other direction. It could grab the show entry first, using the first URL segment, and then could grab the right episode entry using the show -> episode relationship field. Doing it episode first feels a bit cleaner to me, though, because each episode can only belong to one show, whereas each show will have lots of episodes.

       
anthonyscotte23's avatar
anthonyscotte23
1 posts
3 years ago
anthonyscotte23's avatar anthonyscotte23

When you have the episode section, you can snatch the show passage utilizing the relationship field. Something like: barnet tree surgeon

       
1 2

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.