×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Upcoming events module

Upcoming events module 9 years 1 month ago #30383

  • Fabrizio Rossiello
  • Fabrizio Rossiello's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 8
  • Thank you received: 0
Hi
I need to show in the upcoming events module the event image and the event price,
I'm trying adding in the template page of the module (default.php) the following line:
$eventimage = MatukioHelperRendering::getEventImage($event);
but I get this error: Class 'MatukioHelperRendering' not found

Please can some one give me some suggestions?
Thanks in advance
Fabrizio

Upcoming events module 9 years 1 month ago #30384

  • Yves Hoppe
  • Yves Hoppe's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 3519
  • Karma: 71
  • Thank you received: 556
Hi Fabrizio,

you need to import the helper class:

JLoader::register('MatukioHelperRendering', JPATH_ADMINISTRATOR . '/components/com_matukio/helpers/rendering.php');

kind regards,

Yves

Upcoming events module 9 years 1 month ago #30403

  • Fabrizio Rossiello
  • Fabrizio Rossiello's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 8
  • Thank you received: 0
Thanks Yves, now it works! :-)
But I have a similar problem when I add the organizer
In the module template page I add the following line: <?php echo MatukioHelperRendering::getOrganizer($event, $this->organizers); ?>
But I get an error:
Fatal error: Using $this when not in object context in /Applications/XAMPP/xamppfiles/htdocs/aniceverde/templates/t3_bs3_blank/html/mod_matukio_upcoming/default.php on line 76

Where I'm Wrong?
Thanks for you help Fabrizio

Upcoming events module 9 years 1 month ago #30408

  • Yves Hoppe
  • Yves Hoppe's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 3519
  • Karma: 71
  • Thank you received: 556
Hi,

you can't copy code without the context ;-) There is no $this in the module and you need to get the organizer object ($organizer = ...) before using that code. (Query to the database - not that trivial).

Kind regards,

Yves

Upcoming events module 9 years 1 month ago #30436

  • Fabrizio Rossiello
  • Fabrizio Rossiello's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 8
  • Thank you received: 0
Hi Yves and thanks for you reply.
I'm sorry but I'm not a developer, so please can you be more specific about the object ($organizer = ...), may be with an example?
I thanks a lot
Regards
Fabrizio

Upcoming events module 9 years 3 weeks ago #30548

  • Fabrizio Rossiello
  • Fabrizio Rossiello's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 8
  • Thank you received: 0
Hi Yves
Please can you help me with the piece of code?
Thanks

Upcoming events module 9 years 3 weeks ago #30552

  • Yves Hoppe
  • Yves Hoppe's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 3519
  • Karma: 71
  • Thank you received: 556
Hmm it's not just a piece of code i fear, getting the organizer there is a bit complicated, you can try the following (but it could cause problems in some cases):

<?php echo MatukioHelperRendering::getOrganizer($event, null); ?>

But as i said that's not ideal - it would be better to query and get it there directly (±20 lines of code).

Kind regards,

Yves

Upcoming events module 9 years 3 weeks ago #30562

  • Fabrizio Rossiello
  • Fabrizio Rossiello's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 8
  • Thank you received: 0
Thanks Yves
I used the code you suggest (<?php echo MatukioHelperRendering::getOrganizer($event, null); ?>) and it seems to work
Thanks for Help
Fabrizio
  • Page:
  • 1
Time to create page: 0.300 seconds