Support

Home Forums Custom Files Add-on (EE3) Venue in Upcoming Events

Venue in Upcoming Events

Posted: July 1, 2012 at 6:28 pm

Viewing 14 reply threads


dstoddard

July 1, 2012 at 6:28 pm

Hi Guys,

I’m working on adding a few things to my upcoming events.
How do I add the city name?
Plus I would like my title a bit bigger or even bold.

I have been working with this

event_name) ?>Start Date: – start_date) ?>End Date: – end_date) ?><a href="”>Click Here to Book

Thanks in advance
Doug


Josh

  • Support Staff

July 2, 2012 at 12:17 pm

The [ESPRESSO_VENUE] shortcode could be added as a do_shortcode in the widget.php. This shortcode can be configured to display the event address.

To make the title bigger and more bold, you can adjust the font size/weight in the stylesheet. First, wrap the title in a strong or span like so in widget.php:

<strong><?php echo stripslashes_deep($event->event_name) ?></strong>

Then add something like the following to your theme’s stylesheet (or where you’re saving the custom styles):

.events a strong {font-weight:bold; font-size:16px;
}


dstoddard

July 2, 2012 at 2:56 pm

Hi Josh,

I got the title sorted ok but not sure how to get the shortcode into the widget.php.

I only want to show the city and not the full address and price would be great to have in too..

Any thoughts would be great

Thank
Doug


Josh

  • Support Staff

July 2, 2012 at 4:31 pm

Have a look at the event_list.php and event_list_display.php templates handle the venue city. Depending on how you have your venues set up, you should be able to copy some of that code over to the widget.php.

The same could be done for price, or you could use the event_price shortcode.

Look in the shortcode documentation for examples of how to include shortcodes in template files.


dstoddard

July 2, 2012 at 5:31 pm

Hi Josh,

Thanks for you help.. I cant seem to get it to work..
Im prob not copying over the right stuff and I just cant get my head around the shortcode idea.

If there was a easy basic way to explain it to me that would be brill..
Sorry but im a bit ok with bits but cant get this one..

Cheers
Doug


Josh

  • Support Staff

July 3, 2012 at 8:26 am

To add a shortcode into a template, it needs to be wrapped in an echo do_shortcode. For the pricing, it would look like this:

$<?php echo do_shortcode('[EVENT_PRICE event_id="'.$event->id.'" number="0"]');?>

Let’s take a different approach to get the city name and create a new shortcode based on the venue shortcode:
Copy and paste this function into the custom_functions.php file of the custom files addon after the opening <?php or before the closing ?>

Then in widget.php, add this new shortcode:

<?php echo do_shortcode('[ESPRESSO_VENUE_CITY event_id="'.$event->id.'"]');?>


dstoddard

July 3, 2012 at 3:39 pm

Hi Josh,

I have tried the above but not working or showing in the widget.
also the is no ?> in the custom_functions.php file.

Cheers
Doug


Josh

  • Support Staff

July 3, 2012 at 4:36 pm

k
I tested that solution on my test site and it worked. Are you using the venue manager? Can you post the section of widget.php that you modified?


dstoddard

July 3, 2012 at 4:43 pm

Hi Josh,

Im not using venue manager.

Think the problem might be if im not putting it in the right place.
I was going into here..

event_name) ?>Start Date: – start_date) ?>End Date: – end_date) ?><a href="”>Click Here to Book

Would this be right??

Thanks
Doug


Josh

  • Support Staff

July 3, 2012 at 5:20 pm

The code I posted was tested to work with the venue manager.

The code you posted doesn’t look right either. Here’s an example to work off of:

  • This reply was modified 12 years, 4 months ago by Josh. Reason: code formatting


dstoddard

July 3, 2012 at 5:44 pm

Hi Josh,

If you take a look at nifirstaidservices.co.uk and look at the side widget and you will see the layout in trying to get. the blank space under the title is what i get when i input the way you have said..

sorry to ask but is there a different code for the price to display before the vat?? and also a uk £ sign.

Hope that helps.


Josh

  • Support Staff

July 3, 2012 at 5:58 pm

I added some line breaks in the code samples for the sake of readability. Try removing those. Other than that, it might be a theme issue where the br tags are getting automatically added.


dstoddard

July 3, 2012 at 6:07 pm

Hi Josh,

I got it..
city ?> done the job..

Now I need to work at the price.

Thanks again
Doug


Josh

  • Support Staff

July 3, 2012 at 6:33 pm

The event_price shortcode totals everything up, so you might need to customize that function.

The html entity for pounds is &pound;
swap that in place of the $ I used in the sample.


dstoddard

July 3, 2012 at 6:40 pm

Hi Josh,

Thanks again for all your help.. I’m one very happy guy and its looking good..

I updated manually and all working great.
Think its bed time..

Thanks again
Doug

Viewing 14 reply threads

The support post ‘Venue in Upcoming Events’ 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