• 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: Has anyone pimped out their Featured Events module

Has anyone pimped out their Featured Events module 7 years 9 months ago #35221

  • Pomond
  • Pomond's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
  • Thank you received: 3
I was thinking of making some enhancements to the Featured Events module via HTML overrides, and I thought I'd see if anyone here has done it first. I'd basically like the option to display an event with additional info (logo, location, etc.), and not just the event name and date/time.

Has anyone already done this, or know of anything in the wild available for reference, or of a third-party solution that's ready to go? I thought I'd check here first before digging into the HTML overrides.

Any info or help is much appreciated! Thanks for your attention!
The administrator has disabled public write access.

Has anyone pimped out their Featured Events module 7 years 8 months ago #35498

  • Pomond
  • Pomond's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
  • Thank you received: 3
So I've been playing around with this, and I have an HTML override for the Featured Events Module. This is what I have, at [joomla_root]/templates/[template_name]/html/mod_rseventpro_featured/default.php
<?php
/**
* @package RSEvents!Pro
* @copyright (C) 2015 www.rsjoomla.com
* @license GPL, http://www.gnu.org/copyleft/gpl.html
*/
 
// no direct access
defined('_JEXEC') or die('Restricted access');
$open = !$links ? 'target="_blank"' : ''; ?>
 
<ul class="rsepro_featured<?php echo $suffix; ?>">
	<?php foreach ($events as $eventid) { ?>
	<?php $details = rseventsproHelper::details($eventid->id); ?>
	<?php if (isset($details['event']) && !empty($details['event'])) $event = $details['event']; else continue; ?>
	<li>
 
	<div class="imgcontainer"></div>
	<div class="textcontainer">
	    <div class="titlecontainer">
	        <a href="<?php echo rseventsproHelper::route('index.php?option=com_rseventspro&layout=show&id='.rseventsproHelper::sef($event->id,$event->name),true,$itemid); ?>"><?php echo $event->name; ?></a>
	    </div>
	    <div class="datecontainer">
	        <?php echo $event->allday ? rseventsproHelper::showdate($event->start,rseventsproHelper::getConfig('global_date'),true) : rseventsproHelper::showdate($event->start,null,true); ?>
	    </div>
	    <div class="locationcontainer">
	        <?php if ($event->locationid && $event->lpublished && !empty($event->options['show_location_list'])) { ?>
				<span class="rsepro-event-location-block" itemprop="location" itemscope itemtype="http://schema.org/Place"><?php echo JText::_('COM_RSEVENTSPRO_GLOBAL_AT'); ?> <a itemprop="url" href="<?php echo rseventsproHelper::route('index.php?option=com_rseventspro&layout=location&id='.rseventsproHelper::sef($event->locationid,$event->location)); ?>"><span itemprop="name"><?php echo $event->location; ?></span></a>
				<span itemprop="address" style="display:none;"><?php echo $event->address; ?></span>
				</span> 
			<?php } ?>
	    </div>
	</div>
 
 
	</li>
	<?php } ?>
</ul>

Right now, you can see the output for this at mckinleypark.org in the "Featured Events" listing on the home page. I would like to also display an event icon alongside the text ala the RSEventsPro Events view for the component. An example of this is available here: mckinleypark.org/events

I've been looking at the code for the component view to see if I can use it to display the event icons in the Featured Events module. In particular, I found this:
<?php if (!empty($event->options['show_icon_list'])) { ?>
		<div class="rs_event_image" itemprop="image">
			<a href="<?php echo rseventsproHelper::route('index.php?option=com_rseventspro&layout=show&id='.rseventsproHelper::sef($event->id,$event->name),false,rseventsproHelper::itemid($event->id)); ?>" class="rs_event_link thumbnail">
				<img src="<?php echo rseventsproHelper::thumb($event->id, $this->config->icon_small_width); ?>" alt="" width="<?php echo $this->config->icon_small_width; ?>" />
			</a>
		</div>
		<?php } ?>

I've tried various iterations of this image insertion code in my Featured Events module override, but I either get PHP errors ("$this" not instantiated), or it only shows the default icon in a very large format. I know this is what needs to be fixed:
<img src="<?php echo rseventsproHelper::thumb($event->id, $this->config->icon_small_width); ?>" alt="" width="<?php echo $this->config->icon_small_width; ?>" />

Can anyone help come up with the proper syntax to properly display each event's icon? I know I'm close, but being a newbie coder, I can't figure out exactly to what I need to refer to pull in the image.

Thanks in advance for any help or feedback!
The administrator has disabled public write access.

Has anyone pimped out their Featured Events module 7 years 8 months ago #35504

  • Pomond
  • Pomond's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
  • Thank you received: 3
To follow up, I figured out how to do this by looking at the module code for the RSEvents!Pro Events module, which is set to display the event icon. Here's my module override code for mod_rseventspro_featured module:
<?php
/**
* @package RSEvents!Pro
* @copyright (C) 2015 www.rsjoomla.com
* @license GPL, http://www.gnu.org/copyleft/gpl.html
*/
 
// no direct access
defined('_JEXEC') or die('Restricted access');
$open = !$links ? 'target="_blank"' : ''; ?>
 
<ul class="rsepro_featured<?php echo $suffix; ?>">
	<?php foreach ($events as $eventid) { ?>
	<?php $details = rseventsproHelper::details($eventid->id); ?>
	<?php if (isset($details['event']) && !empty($details['event'])) $event = $details['event']; else continue; ?>
	<?php $image = !empty($details['image_s']) ? $details['image_s'] : rseventsproHelper::defaultImage(); ?>
	<li>
 
	<div class="rsepro-image"><a href="<?php echo rseventsproHelper::route('index.php?option=com_rseventspro&layout=show&id='.rseventsproHelper::sef($event->id,$event->name),true,$itemid); ?>"><img src="<?php echo $image; ?>" alt="" width="" /></a></div>
	<div class="textcontainer">
	    <div class="titlecontainer">
	        <a href="<?php echo rseventsproHelper::route('index.php?option=com_rseventspro&layout=show&id='.rseventsproHelper::sef($event->id,$event->name),true,$itemid); ?>"><?php echo $event->name; ?></a>
	    </div>
	    <div class="datecontainer">
	        <?php echo $event->allday ? rseventsproHelper::showdate($event->start,rseventsproHelper::getConfig('global_date'),true) : rseventsproHelper::showdate($event->start,null,true); ?>
	    </div>
	    <div class="locationcontainer">
	        <?php if ($event->locationid && $event->lpublished && !empty($event->options['show_location_list'])) { ?>
				<span class="rsepro-event-location-block" itemprop="location" itemscope itemtype="http://schema.org/Place"><?php echo JText::_('COM_RSEVENTSPRO_GLOBAL_AT'); ?> <a itemprop="url" href="<?php echo rseventsproHelper::route('index.php?option=com_rseventspro&layout=location&id='.rseventsproHelper::sef($event->locationid,$event->location)); ?>"><span itemprop="name"><?php echo $event->location; ?></span></a>
				<span itemprop="address" style="display:none;"><?php echo $event->address; ?></span>
				</span> 
			<?php } ?>
	    </div>
	</div>
 
 
	</li>
	<?php } ?>
</ul>
The administrator has disabled public write access.
The following user(s) said Thank You: rakeshy, webphil3

Has anyone pimped out their Featured Events module 5 years 4 months ago #38587

  • rakeshy
  • rakeshy's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 90
  • Thank you received: 3
If somebody wants to have a bigger image, replace image_s with image_b at line 16
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!