Keyword

K2 Content Module Display a message when no Items

  • Stuart Smith
  • Stuart Smith's Avatar Topic Author
  • Offline
  • New Member
More
11 years 9 months ago - 11 years 8 months ago #117070 by Stuart Smith
Can anyone help me to make the k2 content module display with some text even when no items exist in a category that the module is set to display.

At the moment it does not display at all if there is not an item in the category although it does create the div space for the module?

Site is currently on a local server so cant provide a URL.

Please Log in or Create an account to join the conversation.

  • Stuart Smith
  • Stuart Smith's Avatar Topic Author
  • Offline
  • New Member
More
11 years 1 month ago #117071 by Stuart Smith
Okay bit of an update and a backwards step.

To solve the problem I used the code below to display the message when a user had not entered any items for the module to display to prevent a blank area.
<?php if(count($items) < 1): ?>
 <div id="noitems">No press releases to display</div>
<?php endif; ?>[code type=php]

This has been working great, however, with the upgrade to version 2.6.8 (from 2.6.7) it does not work anymore even though this code was in a module template to stop it being overwritten.

Any ideas on why this is happening?

Please Log in or Create an account to join the conversation.

More
11 years 1 month ago #117072 by Lefteris
Hi. No, this part has been moved to file /modules/mod_k2_content/mod_k2_content.php.

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum