We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

In EE5 there is a Status Menu that which can Output HTML?

How Do I?

yzs's avatar
yzs
40 posts
about 6 years ago
yzs's avatar yzs

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.

       
Robin Sowell's avatar
Robin Sowell
13,158 posts
about 6 years ago
Robin Sowell's avatar Robin Sowell

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.

       
yzs's avatar
yzs
40 posts
about 6 years ago
yzs's avatar yzs

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

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.