• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Override for events list > missing info

Override for events list > missing info 1 month 1 week ago #43330

  • niqui
  • niqui's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
In the event options I can set a text to display a custom message when the event has ended. This text shows up in the event details page. However, I want this text to be visible in the list with events (a listing made a menu-item).
I know how to make overrides, but I'm not a programmer, I have limited php skills. I have found the code for this message in de php file for the view of the event details. When I copy that code in the php file for the listing view, nothing happens, it will not show the message. I'm sure I am in the right file because I have made other changes in the override ;-) So I must be missing something.

Also, I want to copy the code for the button to register for an event in that view. Also not working.

I probably need some extra code to get this view to load the data from database? Can someone help me out?

Thanks in advance!
The administrator has disabled public write access.

Override for events list > missing info 1 month 1 week ago #43334

  • andreic
  • andreic's Avatar
  • NOW ONLINE
  • RSJoomla! Official Staff
  • Posts: 722
  • Thank you received: 59
Hello,

In order to display the "Event has ended" message in the general listing of events you will need to create a template override for the default.php file as described here:
www.rsjoomla.com/support/documentation/r...s-look-and-feel.html

In the override you can use the ongoing status of the event to check if the event has ended, this is already available in the file through the $ongoing variable:
<?php $ongoing = rseventsproHelper::ongoing($event->id); ?>

After verifying this you can display the message you have configured in your event with the help of the following code snippet:
<?php if(!$ongoing) {echo $event->event_ended;}?>

You can display this after the event name:
<?php echo $event->name; ?>

This should look similar to:
<?php echo $event->name; ?> <?php if(!$ongoing) {echo $event->event_ended;}?>

Regarding the event subscription link directly in the default listing, this is not so easily achieved since you will need to make quite a number of verifications before the "Join" link should be displayed, in the following example I only verify if the event has the registration enabled and is not full. For starters we will need to generate the subscribe URL for the event, this can be done by adding:
<?php $tmpl		= '&tmpl=component'; ?>
<?php $subscribeURL	= rseventsproHelper::route('index.php?option=com_rseventspro&layout=subscribe&id='.rseventsproHelper::sef($event->id,$event->name).$tmpl); ?>

...after the following line:
<?php $canDelete = (!empty($this->permissions['can_delete_events']) || $event->owner == $this->user || $event->sid == $this->user || $this->admin) && !empty($this->user); ?>

Then you can add the `Join` button using
<?php if ($event->registration && !$full) { ?>
	<div class="btn-group">
		<a href="<?php echo $subscribeURL; ?>" class="<?php echo RSEventsproAdapterGrid::styles(array('btn')); ?>" rel="rs_subscribe" >
			<i class="fa fa-check fa-fw"></i> <?php echo Text::_('COM_RSEVENTSPRO_EVENT_JOIN'); ?>
		</a>
	</div>
<?php } ?>

... you can add this after the small description:
<?php if (!empty($event->small_description)) { ?>
                <div class="<?php echo rseventsproHelper::layout('event-description'); ?>">
                    <?php echo $event->small_description; ?>
                </div>
<?php } ?>

These examples should provide a good starting point for your desired scenario.
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!