Posted: July 27, 2015 at 6:58 am
|
Hi, I switched over from EE3 to EE4 and momentarily still in development state. In EE3 I did some customisations to the upcoming events widget but I know that this has got overhauled in EE4. I found this post https://eventespresso.com/topic/attempting-to-customize-upcoming-events-widget-no-widget-php-available/#post-102681 on how to customise in EE4. This is what I did in EE3, http://cl.ly/image/3h122K2R323E In widgets.php I can’t find any reference to this section:
I need to do something like this:
Can anyone help me with this? |
Hi Joshua, The section of the widget template that displays the dates is where it pulls in either the espresso_event_date_range() or espresso_list_of_event_dates() template tags. |
|
|
How can I change this template to the example I gave above:
|
Hi Joshua, You copy over the html, then any variables and functions from EE3 need to be changed over to their EE4 counterparts. If you look through the code you’ll find equivalents. For example, in EE3, the Event name was:
In EE4, the equivalent is:
|
|
|
I can’t understand why nothing is changing in the front-end?! I’ve clearly set it up alright. These are the steps I took:
include( 'includes/ee4/widgets.php' );
Changes made to the “Front-end display of widget.” section are not being shown. Can you help me? |
Did you activate your widget in Appearance > Widgets? |
|
|
Yes I did. Still no luck! |
Can you double check the location where your widget code is loading from and check to see if it’s actually loading? You can add a debug echo statement in there too, to check and see if the code is even executing. |
|
|
That worked! http://cl.ly/image/2p2Q1N2N150f So the code is loading fine. |
Hi Joshua, At this point I can only give you guesses as to why it’s not working for you. For example, I don’t know where you put the debug code, and where you checked. One suggestion I can make based on the information you’ve given so far is instead of loading in a widget template, you put the entire widget customization in a plugin file, and activate the plugin. This will ensure everything loads if you’re having trouble with loading the template from another folder or something. This will also help with troubleshooting because if you still have troubles with your code, you can post the entire plugin file into a github gist and link to the gist here and we can investigate. (please do not post a large block of code directly into the forum thread). |
|
|
Hi Josh, Could you by any chance take a look at the website if I provide you with the FTP credentials? |
Hi Joshua, could you try Josh’s suggestion and share your entire code in a gist (https://gist.github.com) or an equivalent online code sharing platform? Then we’ll try it out on a testing site and share feedback. Thanks — |
|
The support post ‘Customize upcoming events widget in EE4’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.