ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Make a secondary template for a secondary template

June 27, 2007 4:09am

Subscribe [1]
  • #1 / Jun 27, 2007 4:09am

    toddajackson

    47 posts

    I recently built a series of stand-up comic profiles for my site. They’re written as such:

    <a href="http://www.dead-frog.com/comedians/comic/comedians_name">http://www.dead-frog.com/comedians/comic/comedians_name</a>

    I’d like to build templates which show all the jokes for a comic and the all the videos for the comic (as well as anything else I come up with) as:

    <a href="http://www.dead-frog.com/comedians/comic/comedians_name/jokes">http://www.dead-frog.com/comedians/comic/comedians_name/jokes</a>

    Right now I’ve built a jokes template that’s in the comedians template group but I don’t really understand what I need to do to make it appear as the above instead of the way it currently appears:

    <a href="http://www.dead-frog.com/comedians/jokes/comedians_name">http://www.dead-frog.com/comedians/jokes/comedians_name</a>

    Am I looking at using mod_rewrite? Do I use url segments? Am I ignorant of an EE feature that makes this easy? Advice please.

  • #2 / Jun 27, 2007 12:54pm

    Robin Sowell

    13255 posts

    Hard to say based on the above.  Let’s focus on how you’re outputting the data, then worry about the urls.  So- I am assuming the comedians each have a weblog entry- and are all of their jokes in a custom field for that entry- then each vid is in its own custom field for that entry, or…

    A lot of ways to set this up- if each comedian only has a single entry, I’d be doing it via relationships most likely- a weblog for comedians, one for vids, one for jokes.  Each vid and joke entry would related back to the comedian- and I’d show that info using reverse relationships.  But- I’m not sure how you’ve got things setup.

    Can you layout the backend structure for us- how is the data entered?

  • #3 / Jun 27, 2007 1:51pm

    toddajackson

    47 posts

    Oh, I already have that set up and it works just grand.

    Jokes - it’s done via reverse relationships. One for Comic, One for Jokes. Eventually that way I’ll also be able to assign jokes to have reverse relationships with the comedians works - CDs and specials.

    Video - all this is pulled in via the YouTube API through a plug-in.

    Right now the main comedian page shows a sample joke and pulls in 4 YouTube videos. But the database has more depth for some comedians - multiple jokes. And there’s a lot more than 4 YouTube videos for some comics (and I want to pull from other sources too eventually.)

    So the structure I got down. I even have rough versions of the “more jokes” pages and “more video” pages. I could polish them up and put them live as the current url structure - but it seems like to me that since the first comedian page is

    ../comedians/comic/comic_name

    then anything else should come after that -

    ../comedians/comic/comic_name/more_jokes
    ../comedians/comic/comic_name/more_video

    Does that help?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases