1
{exp:channel:entries channel="schedule_action | schedule_sports | schedule_hd" }
        //how do i detect channel here.I need to use a if condition.                       
{/exp:channel:entries}

Based on data is coming from which channel,I need to provide some condition.

How do i give a {if channel=="ch_1"}{/if}

1

You're almost there, you have to use the channel short name like this:

{if channel == 'my_channel_name'}
1

yes you can use EE {if} or {switchee} plugin both will work with u

but u must use {channel_short_name} variable {channel} will give u the full channel name not the short one.

I read in the EE User guide comments here http://ellislab.com/expressionengine/user-guide/add-ons/channel/channel_entries.html#10512

that {channel_name} is not documented but it is a shorthand of {channel_short_name} , but I don't try it.

Regard's.

0

Use switchee.

{exp:channel:entries channel="schedule_action | schedule_sports | schedule_hd" }

{!-- Choose appropriate based on source channel --}

{exp:switchee variable="{channel_name}" parse="inward"}

{case value="schedule_action"}

...

{/case}

{case value="schedule_sports"}

...

{/case}

{case value="schedule_hd"}

...

{/case}

{/exp:switchee}

{/exp:channel:entries}

Francois

2
  • how do i set it up?
    – user2133
    Mar 13 '14 at 9:20
  • You can also use the solution from stuartmcd69.
    – worfoual
    Mar 13 '14 at 9:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy