Problems, need help? Have a tip or advice? Post it here.
7 posts Page 1 of 1
Hi,

I have followed the tutorial for creating the blog with list view and page view which all works perfectly.

There is one feature however that I would like to add.

In the list view, if there are no blog entries to display (or if all blog entries within the admin have been deleted), I would like to display a message that states 'No blog entries to display' rather than a blank page.

I'm guessing this is a simple fix, but cant yet figure out how to do it.
Any ideas?
Thanks.
Hi,

We can use the cms:no_results tag for such condition.
An example -
Code: Select all
<cms:pages ..>
   ...
   
   <cms:no_results>
      <h3>No blog entries to display</h3>
   </cms:no_results>
</cms:pages>

Hope this helps.
hi KK - I just happened upon this particular bug and your answer - the no_results tag. I couldn't recollect ever seeing that one and searched the documentation for it and got 'no results'! A very useful tag - I know you have a million and one things to do - but would be good to have it in the docs - thanks!
@potato -
No results for no_results - that is a good one :)

The tag is actually mentioned at viewtopic.php?f=5&t=7377 with some more new tags that debuted with 1.3.5.

That said, I agree, I definitely do need to properly document all the new tags.
Works perfectly. So simple when you know how :D

Thanks KK
You are welcome, @dandan :)
Cool! I've been using a longer method that can be seen here.

Code: Select all
<cms:pages...>

    <!--// other code goes here // -->

    <cms:set no_results='1' scope='global' />
</cms:pages>

<cms:if no_results!='1'>
    <h3>No Results Found</h3>
</cms:if>


Glad to learn this new code :D
---
You live many times, but only ever remember your lives.length - 1
---
Image
7 posts Page 1 of 1