On this link https://docs.expressionengine.com/latest/channels/channel-form/status.html#status-menu
The code is HTML, i thought Status were just for backend use but now can be use as frontend?
So where do I paste the sample code found on that link within which template and which area?
I am talking about the sample template groups included in EE5.
A ‘status’ works on the frontend like any other channel field. So to use it in an channel entries tag, you’d just use {status} to output the value of that particular field.
It’s pretty rare that people do that, but it’s quite common to check for it in a conditional if you have something like a featured status that you want to change the display for.
In the stock templates, you can see us using status on the layouts/_about-layout template:
{exp:channel:entries channel='{layout:ch}' disable='{layout:ch_disable}' dynamic='no' orderby='status' sort='asc' status='{layout:ch_status}'}
{!-- we need to treat the default page link a little differently so we check for the 'Default Page' status and output it, then all other page links output below that. We use the orderby='status' and sort='asc' parameters to accomplish this. --}
{if status == 'Default Page'}
<li><a href="http://{path={layout:p_url}}class=act">{title}</a></li>
{if:else}
<li><a href="http://{path={layout:p_url}/{url_title}}class=act">{title}</a></li>
{/if}
{/exp:channel:entries}
Do be careful, though. The example you linked to is in the channel form tag, which behaves a bit differently than the channel entries tag.
The form tag is just used for making a frontend form for entries. The behavior of the status tags there is a bit unique. In a regular channel entry tag, you just have {status} which is just going to be replaced with whatever status the entry is assigned to.
Hi! What I wanted is to have some kind of ‘filter by Status’ much like having a status option select on the frontend.
What code should I inject it within blog index template?
Much like having to select which of these articles are Recommended, Useful, Influencial and Noteworthy
My status titles are based on the statistics below: If entry has less than 500 of any below then = Open If entry has more comments than the other = Noteworthy If entry has more share/bookmarks than the other = Recommended If entry has more likes than the other = Useful If entry has more unique views than the other = Influencial
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.