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.

3-Segment Templates

October 02, 2012 3:45pm

Subscribe [3]
  • #1 / Oct 02, 2012 3:45pm

    Stuart

    31 posts

    I have a site that will require a URL structure similar to this:

    site.com/products/home/brand_A/
    site.com/products/home/brand_B/

    site.com/products/office/brand_A/
    site.com/products/office/brand_B/

    brand_A and brand_B aren’t URL titles, but is a template that needs to pull all entries that belong to that category(home or office) and that brand. I feel like I’m over-thinking this, but I’m at a loss, so any help is appreciated.

    Thanks

  • #2 / Oct 02, 2012 9:42pm

    mark186282

    290 posts

    do the office and home product template vary greatly?

    Keep your URLs exactly as you have them, and only use one template:

    products (template group)—> index (template)

    in the index template, you can use the variables {segment_2} (home or office) and {segment_3) (brand) to drive the content in that template.  Of course, you can include or not include different things in the template based on the results of those segments as well - so even if the template layouts are greatly different, you can use the one index template to drive everything.

    Note that you can use the search function of the channel entries tag to return only the results you are looking for.

    does that make sense?

  • #3 / Oct 03, 2012 9:55am

    Stuart

    31 posts

    Okay. I’m following you for the most part. I’ll play around and see how it goes. Thanks for the input.

  • #4 / Oct 03, 2012 5:45pm

    Dan Decker

    7338 posts

    Hey Stuart,

    Thanks for posting your question on the forums!

    Building a bit on Mark’s advice, if home and office are channel names, you could have {segment_2} used as a parameter. Now, if you make your Brands categories, you can use Seg2Cat to make things super easy:

    {exp:channel:entries channel='{segment_2}' category="{segment_3_category_id}"}
      <h1>{title}</h1>
      {body}
    {/exp:channel:entries}

    Cheers,

  • #5 / Oct 04, 2012 11:25am

    Stuart

    31 posts

    Dan,

    I think I have a handle on this using the search function that Mark mentioned, but I appreciate you throwing out some more advice.

  • #6 / Oct 05, 2012 3:02pm

    Dan Decker

    7338 posts

    Awesome!

    Is there anything else I can assist you with?

    Cheers,

  • #7 / Oct 08, 2012 1:46pm

    Stuart

    31 posts

    I’m good. Thanks Dan.

  • #8 / Oct 09, 2012 4:27pm

    Shane Eckert

    7174 posts

    Hey Stuart,

    I am really glad to hear that Dan was able to help out!!

    If you need anything else, please just let me know by opening a new thread.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases