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.

Passing custom fields to other tags

August 31, 2011 4:22pm

Subscribe [3]
  • #1 / Aug 31, 2011 4:22pm

    nicktpw

    29 posts

    I’ve created a custom field in my channel that holds a text entry that is the name of a channel.

    I want to put this variable to use in the {exp:channel:categories} tag and use it as the value of channel=”“.

    However, that tag is out of my initial entries loop, so that variable is not making it down to the categories tag, or this option doesn’t work (I can’t tell). Anyone have any insight?

    Thanks.

  • #2 / Sep 01, 2011 4:20am

    John Henry Donovan

    12339 posts

    Hi nicktpw,

    Can you share what you have so far?

    You can pass items from a channel entries loop into an embed if that helps

    Something like this where the channelname parameter is something you come up with.

    {exp:channel:entries channel="news" limit="1"}
    
    {embed="includes/cat" channelname="{your_custom_field}"}
    
    {/exp:channel:entries}

    Then in your embed

    {exp:channel:categories channel="{embed:channelname}"}
    <a href="http://{path=channel/index}">{category_name}</a>
    {if category_description}{category_description}{/if}
    {/exp:channel:categories}


    Does that help?

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

ExpressionEngine News!

#eecms, #events, #releases