Category layout question - "nothing to show right now" solution?

Hello,

first I used one layout for the main blog page and the categories and it worked well until I encountered a category without any posts. Then the frontend just shows “Nothing to Show Right Now” and no way to edit this page.

So I’ve added a condition to some specific div (or section) “Provider Output: isEmpty” in the hope to let this one show, when a category has no posts. But that didn’t work. So I created a layout just for then categories and applied the same condition to a specific div (or section) with the same result. The condition at assignment for the layout itself was set to “Post taxonomy: category”.

The only way it worked, was to set each category one by one as a condition at assignment for this layout. Now the specific div (or section) is shown, when a category has no posts.

Is this as intended, or a bug?… From my logic it should be enough to set the condition for this layout to just “post taxonomy: category”.

best regards
Mirco

Hi Mirco,

Thanks for reaching out.

You can use the {{dc:looper:count}} condition in a specific section in an Archive Layout to check if it is greater than 0 or equal to 0 as shown in the given screenshots. And set the condition All Archives for the layout to set into all the categories.

Hope it helps.
Thanks

Thanks @tristup.

That worked, even if I was confused to use “All Archives” instead of “Post taxonomy:category”. But that way I can skip adding every single category as an assignment condition :slight_smile:

{{dc:looper:count}} == 0 works as well as “Provider Output:is empty” to show the specific div (or section).

best regards
Mirco

Hi Mirco,

Glad that we are able to help you.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.