CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Joomla Extensions (Moderator: lcdweb) »
  • Patch to deal with an empty list of events
Pages: [1]

Author Topic: Patch to deal with an empty list of events  (Read 1882 times)

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Patch to deal with an empty list of events
November 23, 2009, 01:23:39 pm
I found an appearance issue in the case that the module was configured to show a title, but when displayed there were no events. The title (say "Upcoming events") is displayed, and nothing else, which is a bit confusing (especially if there are other elements nearby).

The following patch displays "No events" if there are no events ...

Code: [Select]
--- default.php 2009-10-06 10:17:42.000000000 +1100
+++ /var/www/citybibleforum/modules/mod_civievent/tmpl/default.php 2009-11-24 08:11:05.000000000 +1100
@@ -67,6 +67,11 @@
     }
 }
 
+if ($x == 1) {
+    // No events were displayed.
+    echo '<li>No events</li>';
+}
+
 echo '</ul>';
 ?>
     

It's a bit crude, and I guess it ought to be parameterised: with an option parameter to configure what happens when the event list is empty (Show message, Do nothing (the default)); and a text parameter containing the text to be shown if the list is empty.

Ken

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Joomla Extensions (Moderator: lcdweb) »
  • Patch to deal with an empty list of events

This forum was archived on 2017-11-26.