Keyword

PHP "if" statement for blank module data

  • Andrew Lambert
  • Andrew Lambert's Avatar Topic Author
  • Offline
  • New Member
More
10 years 11 months ago - 10 years 11 months ago #129020 by Andrew Lambert
PHP "if" statement for blank module data was created by Andrew Lambert
Here's the situation. In my item.php I use the following to call up a module in the body:

<h2>Current Courses</h2>

<?php $module = JModuleHelper::getModules('faculty-courses');
echo JModuleHelper::renderModule($module[0]); ?>

However, there are times where there the data within that module is actually blank, and if that's the case I'd like to use an "if" statement to hide the <h2> heading just before that module.

Any help would be much appreciated.

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

More
10 years 11 months ago #129021 by Lefteris
Replied by Lefteris on topic Re: PHP "if" statement for blank module data
Hi. This has nothing to do with K2. It has to do with the way Joomla! renders modules. Read docs.joomla.org/Customising_the_way_modules_are_displayed to learn about module chromes. Then you will be able to apply an if statement for the module title.

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


Powered by Kunena Forum