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.

Creating templates for 4+ segments

January 30, 2012 11:55am

Subscribe [3]
  • #1 / Jan 30, 2012 11:55am

    stevealfa

    11 posts

    I’m sure this can’t be difficult as EE supports upto 9 url segments but I can’t find or figure out how I can template anymore then 3 segments, could anyone advise on how I can accomplish this please?

    The way I do this is
    Template group index is segment 1,
    template group > template1 is segment 2
    and template group > template2 > url_title is segment 3

    how can I go beyond this with a ‘global’ template for segment 4+?

    Thanks,

    I’m using EE2

  • #2 / Jan 30, 2012 2:31pm

    Boyink!

    5011 posts

    You can insert segments past that, but they don’t have a hard relationship to specific templates.  You end up handling multiple segment conditions in a shared template using conditionals.

  • #3 / Jan 30, 2012 4:46pm

    Andrew Fairlie

    126 posts

    Boyink is right. You’ve exhausted the built-in levels of templates at that level.

    What you could do at the segment_3 template is something like

    {if segment_4}
        {embed="template-group/segment4-template"}
      {if:else}
        {embed="template-group/segment3-template"}
      {/if}

    The above basically outlines “If you’ve gotten to this template and there’s a fourth segment, go ahead and load that template else we can reasonably presume there’s only 3 segments so load that template.

  • #4 / Jan 30, 2012 4:56pm

    stevealfa

    11 posts

    Thanks for the replies, that is pretty much what I was looking for I just couldn’t get my head around it so that was really helpful,

    Thanks.

  • #5 / Jan 31, 2012 1:24pm

    Kevin Smith

    4784 posts

    Thanks for the help, Mike and Andrew! Steve, let us know if there’s anything else we can help with!

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

ExpressionEngine News!

#eecms, #events, #releases