Support

Home Forums Event Espresso Premium Add venue title to widget output

Add venue title to widget output

Posted: March 9, 2013 at 3:13 am


kapow99504

March 9, 2013 at 3:13 am

I’m trying to add the venue title to my Widget output but can’t seem to get the widget.php to pull in the correct information, any advice?


Tony Warwick

March 9, 2013 at 1:27 pm

The widget doesn’t pull any of the venue information in from the database if your using the venue manager so you’ll have a little more work to do.

You need to alter the SQL query to include the venue table and the venue relationship table, then within the for each loop assign a venue_name variable and use that within the widget as you would anything else.

Look into event_list.php and it’ll help you along.


kapow99504

March 9, 2013 at 2:21 pm

Thanks Tony, I’ll check it out


Tony Warwick

March 9, 2013 at 2:45 pm

I’ve just had a quick look at this.

The SQL function starts from line 49 in widget.php

I’ve added the Venue database calls into the SQL query.

Replace the if statment from lin 49 down to the close } for the ‘else’ not sure on line number as I’ve already alter it.

http://pastebin.com/q35N96Wp

After that look at line 91 onwards… copy line 93 (should be about the event name)

Paste it below on line 94 and change all instances event_name to venue_name on that line.

then you can just use $event->venue_name for example echo $event->venue_name

Only had a quick look but that should work. Let me know if you have problems. Don’t forget to copy widget.php uploads/event-espresso/templates.


Tony Warwick

March 9, 2013 at 2:48 pm

I can’t post code so to explain > is a greater than sign.

As in, shift and period (full stop) on most qwerty keyboards.


Tony Warwick

March 9, 2013 at 2:49 pm

lol nevermind, hopefully you know what I mean.


kapow99504

March 10, 2013 at 4:32 pm

Worked like a charm, thanks Tony!

The support post ‘Add venue title to widget output’ 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.

Event Espresso