1

I currently have a block of code that looks like

And the problem I'm trying to resolve is that I have a section on a different page using all of these statuses in their own divs to create a sort of Editor's Choice area. shown here:

THE FEATURED STATUS
{exp:channel:entries channel="news|blog|misc" limit="1" dynamic="no" status="Featured"}
  <div class="featured img">
    an image
  </div>
  <div class="featured text">
    text that links to article view template
      <div><a class="color-red lg featured read-more" href="{site_url}{channel_short_name}/view/{url_title}">Full Article&hellip;</a>
      </div>
  </div>
{/exp:channel:entries}  

EDCHOICE STATUS
{exp:channel:entries channel="news|blog|misc" limit="1" dynamic="no" status="EdChoice"}
  <div class="EdChoice1 img">
    an image
  </div>
  <div class="EdChoice1 text">
    text that links to article view template
      <div><a class="color-red lg featured read-more" href="{site_url}{channel_short_name}/view/{url_title}">Full Article&hellip;</a>
      </div>
  </div>
{/exp:channel:entries} 

EDCHOICE STATUS
{exp:channel:entries channel="news|blog|misc" limit="1" dynamic="no" status="EdChoice"}
  <div class="EdChoice2 img">
    an image
  </div>
  <div class="EdChoice2 text">
    text that links to article view template
      <div><a class="color-red lg featured read-more" href="{site_url}{channel_short_name}/view/{url_title}">Full Article&hellip;</a>
      </div>
  </div>
{/exp:channel:entries}  

And those populate perfectly fine. And the articles pulled with EdChoice status work when clicked on basically pulling up their respective channels view template and displaying the article. HOWEVER, anything with the status of Featured shows and goes to the correct url, but does not display and obviously redirects to my 404 page. Here is a block of what's in my view template, of which all the articles (EdChoice, Featured, Open, or otherwise) are pulling:

 {exp:channel:entries site="{site_short_name}" channel="news|blog|misc" url_title="{segment_3}" limit="1" dynamic="no" status="Open|Featured|EdChoice" require_entry="yes"}
    {if no_results}{redirect="404"}{/if} 
    <h1><span itemprop="name">{title}</span></h1>
            etc etc 
 {/exp:channel:entries} 

And when I changed THE FEATURED STATUS block status to status="EdChoice" the view page works fine. I'm not sure what's going on here. Has anyone encountered this before? Or know what I'm doing wrong as I am new to using multiple statuses

2
  • Have you checked that you have a status called "Featured" (with a capital F) and it's correctly spelt? Nov 9, 2013 at 5:20
  • Yep, has a capital F and everything.. hahaha.
    – Cedric
    Nov 11, 2013 at 16:40

4 Answers 4

1

Remove everything from your template and just add this:

 {exp:channel:entries channel="news|blog|misc" status="not closed"}
    {title} 
 {/exp:channel:entries} 

If this works, start adding code back in piece by piece until things break.

1
  • I removed everything and worked my way up on a new template group, everything works fine-but, when I pull that exact code into other templates is when it fails. There are some snippets etc on those pages that I'm going to take a look at -also there is a user-friendly version of control panel built to mirror what's going on channel entry wise with EE's default control panel using safecracker also feeding and populating into a holding ground for all of the articles which are then shipped out in snippets and custom field groups, so I'll look a little deeper to see what's going on there...
    – Cedric
    Nov 11, 2013 at 16:26
1

The exp:channel:entries tag by default only looks for status="open" entries.

Might be best to use status="not closed" in your setup. This will show all entries except those using the "closed" status.

1
  • I have tried using status="not closed" with no success already. swapping out status="Open|Featured|EdChoice" for status="not closed"
    – Cedric
    Nov 8, 2013 at 21:20
1

Because you are setting url_title="{segment_3}" and dynamic="no" try removing the require_entry="yes" parameter from your exp:channel:entries tag.

OR

Remove url_title="{segment_3}" and dynamic="no", and leave the require_entry="yes" parameter.

2
  • {exp:channel:entries site="{site_short_name}" channel="news" limit="1" dynamic="no" status="Open|Featured|EdChoice"} {if no_results}{redirect="404"}{/if} <h1><span itemprop="name">{title}</span></h1> etc etc {/exp:channel:entries} {exp:channel:entries site="{site_short_name}" channel="news" limit="1" dynamic="no" status="not closed"} {if no_results}{redirect="404"}{/if} <h1><span itemprop="name">{title}</span></h1> etc etc {/exp:channel:entries}
    – Cedric
    Nov 8, 2013 at 21:51
  • tried both of these and still no cigar.
    – Cedric
    Nov 8, 2013 at 21:51
1

Remove site="{site_short_name}" from your tag. This parameter isn't present on your working code.

2
  • Hmmm.. so I tried that and I swear it was going to work when I hit update finished and refreshed.. but it didn't. OH my?
    – Cedric
    Nov 8, 2013 at 22:43
  • The current 2 code options I've tried. {exp:channel:entries channel="news" limit="1" dynamic="no" status="Open|Featured|EdChoice"} {if no_results}{redirect="404"}{/if} <h1><span itemprop="name">{title}</span></h1> etc etc {/exp:channel:entries} {exp:channel:entries channel="news" limit="1" dynamic="no" status="not closed"} {if no_results}{redirect="404"}{/if} <h1><span itemprop="name">{title}</span></h1> etc etc {/exp:channel:entries}
    – Cedric
    Nov 8, 2013 at 22:44

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.