2

I've created the following conditional which is displaying 0 content:

{exp:channel:entries channel="patterns" orderby="title" status="pending|camera-ready|closed|open"}
{if oldnotes != "" }
    <ul>
    <li>{title}</li>
    </ul>
{/if}
{/exp:channel:entries}

I know there are a couple hundred entries with this field so I'm wondering what is wrong. It is just a text area field.

7
  • Are you on a page that is relative to the entries you're trying to pull in? If you're not then you'll need to be sure to add the dynamic='no' parameter to the exp:channel:entries tag. Commented Mar 27, 2014 at 0:15
  • I am making a page simply to check for content there so I can move it and delete the field. I had not added the dynamic="no" so I went back and did it but field still resolving empty.
    – user2867
    Commented Mar 27, 2014 at 0:33
  • Have you tried what Mattsidjohn suggested? Commented Mar 27, 2014 at 15:38
  • I just tried both ways and still resolving no results.
    – user2867
    Commented Apr 10, 2014 at 19:11
  • Is oldnotes a text or textarea field? Try this: {exp:channel:entries channel="patterns" status="pending|camera-ready|closed|open" } {count} of {total_results} {if oldnotes} --- {title} {/if} <br> {/exp:channel:entries} Commented Apr 26, 2014 at 3:01

1 Answer 1

1
{exp:channel:entries channel="patterns" orderby="title" status="pending|camera-ready|closed|open"}
{if "{oldnotes}" != "" }
    <ul>
    <li>{title}</li>
    </ul>
{/if}
{/exp:channel:entries}

That should give you the results you need, or you could use this method.

{exp:channel:entries channel="patterns" orderby="title" status="pending|camera-ready|closed|open"}
{if oldnotes}
{if:else}
    <ul>
    <li>{title}</li>
    </ul>
{/if}
{/exp:channel:entries}

I would also suggest you try to use

{if no_results}
   <p>Hello World</p>
{/if}

To test your entries tag is returning results.

3
  • The first ex resolves empty even though I know there are multiple entries with info in the field. The second way shows me all the entries where oldnotes is blank and I tried adding {if "oldnotes" == "" } so that I see the reverse however then I get no results..
    – user2867
    Commented Apr 10, 2014 at 19:09
  • add the parameter dynamic="no" and try my first example if statement. Commented Apr 10, 2014 at 21:03
  • I have tried that and it's still resolving no content.
    – user2867
    Commented Apr 16, 2014 at 0:02

Your Answer

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

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