Created
November 12, 2012 13:45
-
-
Save RyanRoberts/4059473 to your computer and use it in GitHub Desktop.
If no results I don't want the .articles div or main h1. Without using {if no_results} to output content.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="articles"> | |
<h1>Recent Articles</h1> | |
{exp:channel:entries channel="articles"} | |
<article> | |
<h1>{title}</h1> | |
{body} | |
</article> | |
{/exp:channel:entries} | |
</div> |
@cwcrawley your example won't work with pagination (and when not on the first page).
{total_results} - Total results being displayed
{absolute_count} - The absolute “count” out of the current entries being displayed by the tag, including those entries on previous pages (if using pagination).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You could probably do something like the following:
{exp:channel:entries channel="articles"}
{if count==1}
Recent Articles
{/if}{title}
{body} {if count==absolute_count}{/if}
{/exp:channel:entries}