Event Thumb Image inside Events Booking module

  • George Pl
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 1 week ago - 10 years 1 week ago #78798 by George Pl
Hi

I made an override to html/mod_eb_events/improved.php and works fine.
Can you please tell me the code to call and insert the event Thumb Image somewhere there?
Well and Short description php call will be also really useful.

Thank you
Last edit: 10 years 1 week ago by George Pl. Reason: addition

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

More
10 years 1 week ago #78828 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Event Thumb Image inside Events Booking module
1. To insert thumbnail, you can use this code:
Code:
<?php if ($$row->thumb && file_exists(JPATH_ROOT.'/media/com_eventbooking/images/thumbs/'.$row->thumb)) { ?> <img src="<?php echo JUri::base(true).'/media/com_eventbooking/images/thumbs/'.$row->thumb; ?>" class="eb_event_thumb"/> <?php } ?>

2. To show short description, just use
Code:
echo $row->short_description;

Regards,

Tuan
The following user(s) said Thank You: George Pl

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

  • George Pl
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 1 week ago #78835 by George Pl
Replied by George Pl on topic Event Thumb Image inside Events Booking module
Hi Tuan,

1. The whole code did not work, and gave me a blank screen with only the start of one event html stripped.
I used this code only :
Code:
<img src="<?php echo JUri::base(true).'/media/com_eventbooking/images/thumbs/'.$row->thumb; ?>" class="eb_event_thumb"/>
and worked. Is something that I have to worry about if there is no image?

2. Short description worked fine. I tried to truncate it using this code:
Code:
JLoader::register('JHtmlString', JPATH_LIBRARIES.'/joomla/html/html/string.php');
and
Code:
<?php echo JHtml::_('string.truncate', ($row->short_description), 200); ?>
but did not work.
Any help on this will be highly appreciated.

Thank you anyway for your help.

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

More
10 years 1 week ago #78841 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Event Thumb Image inside Events Booking module
Hi

1. The code I gave have an extra $, sorry. Could you try this new code:
Code:
<?php if ($row->thumb && file_exists(JPATH_ROOT.'/media/com_eventbooking/images/thumbs/'.$row->thumb)) { ?> <img src="<?php echo JUri::base(true).'/media/com_eventbooking/images/thumbs/'.$row->thumb; ?>" class="eb_event_thumb"/> <?php } ?>

2. The code looks OK to me. It is a Joomla core code, so it should work. Could you please let us know the problem you are having with that code ?

Tuan
The following user(s) said Thank You: George Pl

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

  • George Pl
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 1 week ago - 10 years 1 week ago #78844 by George Pl
Replied by George Pl on topic Event Thumb Image inside Events Booking module
Hi

1. Thanks it worked, no problem now.

2. Also working fine right now without any change, it was a code fault somewhere else, so all fixed now.

Thanks again
Last edit: 10 years 1 week ago by George Pl. Reason: changed status to answered!

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

Moderators: Tuan Pham Ngoc