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.

Issue With Related Entries - Custom Fields

April 26, 2011 4:03pm

Subscribe [3]
  • #1 / Apr 26, 2011 4:03pm

    danakm

    75 posts

    I am trying to use related custom fields. I got the following to work on the live page but I keep getting an error when updating the template that says:

    {exp:channel …
    No closing tag found. Note: some tags do not require closing.

    Here is the offending code:

    {exp:channel:entries channel="shows" orderby="title" sort="desc" limit="1"}    
    {if showvideo}
    {exp:channel:entries channel="spnsrbanrs" category="13" limit="1" dynamic="no" custom_fields="yes"}{related_entries id="bnrelate"}{vdsho_banner}
    {/related_entries}{/exp:channel:entries}
    {/if}
    {/exp:channel:entries}

    Can someone help me to make the code work properly?

    Thanks so much.

    Dana

  • #2 / Apr 27, 2011 6:40am

    John Henry Donovan

    12339 posts

    Dana,

    It would not be recommended to split channel:entries tags like this with conditionals. Try this instead

    {if showvideo != ""}
    
    {exp:channel:entries channel="spnsrbanrs" category="13" limit="1" dynamic="no" custom_fields="yes"}{related_entries id="bnrelate"}{vdsho_banner}
    {/related_entries}
    {/exp:channel:entries}
    
    {if:else}
    {exp:channel:entries channel="shows" orderby="title" sort="desc" limit="1"}
    
    {/exp:channel:entries}
    {/if}
  • #3 / Apr 27, 2011 10:51am

    danakm

    75 posts

    This did not work either. I think I will just simplify the client’s life and mine and make the banners custom fields with each show.

    Thanks for the help though.

  • #4 / Apr 28, 2011 2:48pm

    Sue Crocker

    26054 posts

    Hi, Dana - in that case closing the thread.. Don’t hesitate to post again as needed.

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

ExpressionEngine News!

#eecms, #events, #releases