Plugin Author
Barry
(@barryhughes-1)
Hi!
That’s definitely possible – you just need to set up a custom template. Start by grabbing this file:
events-calendar-pro/views/pro/widgets/list-widget.php
Copy it to your theme:
your-theme/tribe-events/pro/widgets/list-widget.php
Then place your changes in there – here are a few more links to help out:
Good luck!
wait, I don’t want to customize tri.be’s list-widget.php template,
I want to customize event-rocket’s shortcode: [event_rocket_list]
or am I just not understanding something above?
how do I edit your event_rocket_list shortcode?
Plugin Author
Barry
(@barryhughes-1)
All of the shortcodes provided by Event Rocket – with the exception of [event_embed] – are simply wrappers around the existing widgets.
[event_rocket_list] for example is a wrapper for the events list widget: the whole idea is that they give you the ability to embed the widgets easily in pages and posts via a shortcode.
The actual work though is still done by the relevant widget code within The Events Calendar/Events Calendar PRO.
If you only want your customizations to show when the widget is deployed via a shortcode that’s completely possible, but will take just a little more work.
One approach would be to “listen” for an event signifying that the widget is about to be embedded via a shortcode – you could leverage one of two filter hooks for this purpose:
- event_rocket_shortcode_tribeeventslistwidget_arguments
- event_rocket_shortcode_tribeeventslistwidget_attributes
Or if you are using Events Calendar PRO:
- event_rocket_shortcode_tribeeventsadvancedlistwidget_arguments
- event_rocket_shortcode_tribeeventsadvancedlistwidget_attributes
Then, set some sort of flag to indicate that the widget is in “shortcode mode”, if you will. Next, in your template override, you can test to see if the flag is set and load in an alternative template (don’t forget to reset the flag afterwards).
This has the benefit of leaving the regular widget styling and appearance intact whilst letting you configure the shortcode list with an entirely different structure.
I hope that helps!
Ah! I understand much more now. Thanks for that explanation. Really appreciate it.