0

I need a way to show channel:entry content filtered by statuses open vs custom on a single entry page.

Like so: - Show basic fields and their content if status is “open” - Show ALL fields when status is “custom”.

I tried to use conditional inside of channel:entry loop but that didnt get me anywhere but errors. So seems that using if status=“custom” is not available for to use (bummer)...

How I can hide/show content on entry page depending on entry status?

Is the only way to make 2 channel:entry looping pairs with other having status set to “open” and putting fields I want to show inside, and then double it and changing status to “custom” and putting all fields inside of that looping pair?

Am I missing something that can be used to filter content fields with status parameter using only one channel:entry looping pair?

Thanks in advance.

1 Answer 1

0

You should be able to just use the {exp:channel:entries} tag pair, define both statuses in the status="" parameter, and then use a conditional to show status-specific content.

{exp:channel:entries status="open|custom" ... }

    Shared fields

    {if status == 'open'}
        Fields for status Open
    {/if}

    {if status == 'custom'}
        Fields for status Custom
    {/if}

{/exp:channel:entries}
3
  • Thank you Low. I missed that and tried to use conditional like if status="custom" - but with if status == 'custom' I got things working!
    – Riverboy
    Feb 22, 2015 at 9:41
  • Interesting. It worked just once. Now I dont get anything showing up within if status == 'custom' even that i have 2 entries that has status set to custom. Need to study more because I have a lot of stuff on this entry page that why that did work just once but not anymore.
    – Riverboy
    Feb 22, 2015 at 10:12
  • I think I found solution. You have to have Exact word. So using 'custom' does not work but 'Custom' works. So it has to start with capital letter if you have created the custom status that way! while when you use status as a parameter, it does works with lower case. This was interesting and was the last thing I tried after dropping out all other codes, parameters, conditionals etc :)
    – Riverboy
    Feb 22, 2015 at 12:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.