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.

Blank Screen Trying to Embed Template Based on URL Segment

June 01, 2009 3:15pm

Subscribe [3]
  • #1 / Jun 01, 2009 3:15pm

    kirkaracha

    273 posts

    Why does this code produce a blank screen?

    {if segment_3 == "media-coverage")
    {embed="events/_media_coverage"}
    {if:else}
    {embed="events/_main_page"}
    {/if}

    ExpressionEngine 1.6.6/Build: 20081212

    The template works fine without the conditional logic, and the templates I’m trying to embed work if I embed them on their own.

  • #2 / Jun 01, 2009 4:55pm

    Ingmar

    29245 posts

    Try to reduce the complexity of your code so we see where it breaks, exactly. Don’t use an emebed but simple text markers. You can also try simple conditionals as opposed to advanced ones. Have you turned on error reporting?

    In closing, I recommend to upgrade to the current version of EE 1.6.7. It’s a security update.

  • #3 / Jun 01, 2009 5:14pm

    Mark Bowen

    12637 posts

    Is that code above exactly as you have it in your template? If so then you have an error on line 1 at the very end.

    You have a normal bracket instead of a curly bracket. Code should be this :

    {if segment_3 == "media-coverage"}
    {embed="events/_media_coverage"}
    {if:else}
    {embed="events/_main_page"}
    {/if}

    Should work with the above code.

    Hope that helps a bit.

    Best wishes,

    Mark

  • #4 / Jun 01, 2009 5:19pm

    Ingmar

    29245 posts

    Good eye there, Mark. Was that the issue, kirkaracha?

  • #5 / Jun 01, 2009 5:22pm

    Mark Bowen

    12637 posts

    Good eye there, Mark. Was that the issue, kirkaracha?

    ‘twas a different colour in the forum so that helped a bit 😉

  • #6 / Jun 02, 2009 5:00am

    Ingmar

    29245 posts

    kirkaracha, any news?

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

ExpressionEngine News!

#eecms, #events, #releases