Support » Plugin: Event Organiser » Customise Event Widget output
Customise Event Widget output
-
Hi
I have just upgraded the plugin to version 1.5.7. I can’t figure out how to customise the widget output like I had it before.
In the previous version I replaced line 132 in the “class-eo-event-list-widget.php” file:
echo '<li><a title="'.the_title_attribute(array('echo'=>false)).'" href="'.get_permalink().'">'.esc_html(get_the_title()).'</a> '.__('on','eventorganiser').' '.eo_format_date($post->StartDate.' '.$post->StartTime, $format).'</li>';
with
echo '<div class="newsdate"><p style="padding: 0; margin: -10px 0 -20px; font: 45px Impact">'.eo_get_the_start('d').'</p><p>'.eo_get_the_start('M').'</p></div><p style="color: #fff; padding-right: 20px"><a style="color: #fff;text-decoration: none;font-size:14px;" title="'.the_title_attribute(array('echo'=>false)).'" href="'.get_permalink().'">'.esc_html(get_the_title()).'</a></p><br clear=all>';
I would like to know how to do this in the new version. I have tried a few ways of getting rid of the bullet list and changing the date format, but it has not worked.
I am using the widget to display a list of upcoming training – right now it looks shocking.
The display is next to the picture on the right on the homepage at http://skillsafrica.com
Please help!
-
Hi Stephen
Ok further to that I have added the following to the widget template line after more reading here on the forum (and have moved style detail to style.css to make it easier):
<div class="newsdate"><p class="newsdatepara">%start{j}%</p><p>%start{M}%</p></div><p class="coursedetailpara"><a class="courselink" href="%event_url%">%event_title%</a></p>
This is now almost displaying as I want. Almost.
The unordered list is still there when I look at the page source so it is messing with my layout. What I really would like is to remove this for purposes of the widget – but retain it for the event pages used elsewhere. As the css class for the unordered list is the same for both listings I can’t just edit that.
I tried using a shortcode, but had the same result.
Please advise how I can remove the unordered list from just the class-eo-event-list-widget output.
Many thanks
Hi CatR,
Yes the problem with the existing ‘template’ option is that it assumes that the mark-up will still sit inside an unordered list. There currently isn’t a way round this without editing the core files (which itself has the problem of being lost when you update).
You may be interested in this thread – in 1.6. I’ll be adding a filter to enable you to provide your own template file – responsible for containing the entire mark-up giving you complete control. Its only an experimental feature though.
For the time being, the function you need to edit is
eventorganiser_list_events
. Ensure the template option for the widget is empty, and there is a couple of things you’ll want to edit:- This line: which wraps the event list
- And this line: which determines what appears for each event
- The topic ‘Customise Event Widget output’ is closed to new replies.