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.

URL segments and embed tags

July 22, 2010 1:12pm

Subscribe [3]
  • #1 / Jul 22, 2010 1:12pm

    than

    10 posts

    I’m using the following code to attempt to embed different templates, but loading the /cabins/ URL results in an empty page.

    EE doesn’t load the site/section-home template, nor the {embed:site/header} and {embed:site/footer} templates that all load successfully on the homepage index template…


    Do I have something wrong?

    {if segment_1==""}
        {embed="site/homepage"}
    {if:elseif segment_1=="cabins"}
        {embed="site/section-home" site_section="cabins"}
    {/if}
  • #2 / Jul 22, 2010 3:49pm

    Ingmar

    29245 posts

    What version and build of EE are you using? Try to reduce your template’s complexity, avoiding embeds and advanced conditionals during testing. Take a simple template an add to it until it breaks.

  • #3 / Jul 22, 2010 6:02pm

    than

    10 posts

    Perhaps my design pattern needs a rethinking…

    What I’m attempting is:

    The site needs essentially one template while maintaining control over template elements based on what’s in a particular channel entry. Are pages a better route?

    Also important to the client is that URLs not go more than two ‘directories’ deep. So my attempt above is to have each segment_1 call the ‘homepage’ for each section and each segment_2 therein call an entry in that section/channel.

    I hope that’s followable…

  • #4 / Jul 22, 2010 6:06pm

    than

    10 posts

    Forgot to mention that I’m on a freshly installed 2.1.0 build 20100712.

    The site templates are fully built in HTML/CSS and I’m just transferring the content into the CMS.

  • #5 / Jul 22, 2010 7:59pm

    than

    10 posts

    Well, let’s close the book on this one…

    I’d been led down this path after having some difficulty with the Pages module—which turned out to be the Honor DST bug ( https://support.ellislab.com/bugs/detail/13160/ )

    So, with that my template structure should be A LOT simpler. Whew.

  • #6 / Jul 23, 2010 1:40am

    John Henry Donovan

    12339 posts

    thanhost,

    Also important to the client is that URLs not go more than two ‘directories’ deep. So my attempt above is to have each segment_1 call the ‘homepage’ for each section and each segment_2 therein call an entry in that section/channel.

    This is indeed only possible using the Pages module or a third-party offering like Structure.

    Typical single entry URLs are in the format

    http://www.example.com/index.php/template_group/template/my_url_title/

    How are you fairing now after adjusting your install for the bug?

  • #7 / Jul 23, 2010 11:26am

    than

    10 posts

    How are you fairing now after adjusting your install for the bug?

    Quite well, John. Now that I’ve got Pages working, I won’t need to futz around with conditionals to sort them out from the one channel that actual doesn’t need the strict URL structure.

    (Minus the bug..) I’m really enjoying my first dive into EE.

  • #8 / Jul 23, 2010 11:29am

    Ingmar

    29245 posts

    Glad to hear it. Please post again in case there’s anything else.

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

ExpressionEngine News!

#eecms, #events, #releases