Support

Home Forums Event Espresso Premium Styling Venue Manager

Styling Venue Manager

Posted: July 19, 2016 at 11:54 am

Viewing 17 reply threads


Maccabee Levine

July 19, 2016 at 11:54 am

Currently when I use your shortcode [ESPRESSO_VENUE id=”1″] the city, state and zip appears on a separate lines. Is it possible to have them appear on one line?


Tony

  • Support Staff

July 20, 2016 at 5:55 am

Hi there,

To confirm, your using EE3 correct?

To do that with EE3 you would need to create you own custom function to output the replace the function used to output the details. You can then format the venue information however you prefer when output.

You can use the Custom Files Add-on to add your own ‘espresso_venue_details_sc’ function that could override the default function.

How comfortable are you with PHP?


Tony

  • Support Staff

July 20, 2016 at 5:56 am

Actually it may also be possible to use some CSS to work around this, can you link me to where you are currently using that shortcode? I’ll see if I can find some CSS for that page.


Maccabee Levine

July 20, 2016 at 6:00 am

https://quantum.esu.edu/theatre/


Tony

  • Support Staff

July 20, 2016 at 6:12 am

This should work, although not in all browsers.

Using your own custom PHP function would be the preferred method but you can try this:

/* Set the br tags content to a space /*
.event_venue .venue_details br:nth-of-type(2),
.event_venue .venue_details br:nth-of-type(3) {
    content: ' ';
}

/* Add a comma after the BR tag */
.event_venue .venue_details br:nth-of-type(2)::after,
.event_venue .venue_details br:nth-of-type(3)::after {
    content: ', ';
}

We recommend using either the My Custom CSS or Reaktiv CSS Builder plugins to add custom styles such as these.


Maccabee Levine

July 20, 2016 at 6:40 am

Awesome that did it. You are a genious.


Tony

  • Support Staff

July 20, 2016 at 7:27 am

Thank you.

I’m no genious… crazy, evil professor maybe, but no genius πŸ˜‰

Any further problems/questions just let us know.


Maccabee Levine

July 26, 2016 at 11:19 am

Tony, I just realized that the styles you offered above only works in Chrome. IE and Firefox display the address as:

1282 Centre Street
East Stroudsburg
Pa
18301


Tony

  • Support Staff

July 27, 2016 at 6:00 am

In that case you’ll need to either create your own shortcode to pull in the information and display it how you prefer, or modify the code used to generate the default shortcode and override the default.

The latter can be done by creating a new PHP file called custom_functions.php within /wp-content/uploads/espresso/ (the start of the file should be an opening php tag – <?php)

Copy the espresso_venue_details_sc() function from \event-espresso\includes\shortcodes.php around line 667 to 840 and place the function within the file. Then remove the BR tags from the city, state and zip output.


Maccabee Levine

July 27, 2016 at 6:42 am

Thank you Tony


Tony

  • Support Staff

July 27, 2016 at 6:45 am

You’re most welcome πŸ™‚


Maccabee Levine

July 27, 2016 at 8:16 am

Do I exclude this

if (!function_exists(‘espresso_venue_details_sc’)) {

on line 662


Maccabee Levine

July 27, 2016 at 11:23 am

got it to work πŸ™‚


Maccabee Levine

July 27, 2016 at 11:25 am

spoke too soon. I was looking in Chrome. IE and Firefox are still returning the city, state and zip on separate lines.


Maccabee Levine

July 27, 2016 at 11:28 am

These are the 3 lines I removed the <br /> tags from.

$html .= $venue->city != ” ? stripslashes_deep($venue->city) : ”;
$html .= $venue->state != ” ? stripslashes_deep($venue->state) : ”;
$html .= $venue->zip != ” ? stripslashes_deep($venue->zip) : ”;

Do I need to make reference to the custom_function.php file any place other than placing it in /wp-content/uploads/espresso/?


Maccabee Levine

July 27, 2016 at 11:36 am

Sorry, I did get it to work this time. The only issue is there are no spaces between city and state and I need a comma after city.


Maccabee Levine

July 27, 2016 at 11:48 am

I able to figure out the comma and whitespace.


Tony

  • Support Staff

July 28, 2016 at 4:32 am

Sorry for the delay, I’m glad you have this working but to answer your questions:

Do I exclude this
if (!function_exists(β€˜espresso_venue_details_sc’)) {
on line 662

No, that checks if the function already exists before attempting to declare it. It won’t actually make a difference because EE loads custom_functions.php before declaring its functions, but your best not including it.

Sorry, I did get it to work this time. The only issue is there are no spaces between city and state and I need a comma after city.

That’s from this code:

$html .= $venue->city != ” ? stripslashes_deep($venue->city) : ”;
$html .= $venue->state != ” ? stripslashes_deep($venue->state) : ”;
$html .= $venue->zip != ” ? stripslashes_deep($venue->zip) : ”;

If checks if there is a value set for the variable $venue->city != ”

If true it outputs the first section of code up to the : so that should be:

stripslashes_deep($venue->city)

You want a comma and space after the value, so that should be:

stripslashes_deep($venue->city) . ', '

If no value is set it outputs whatever is after the : on that line (in this case an empty string).

I know you’ve already figured this out but just adding here incase anyone else comes across this thread πŸ™‚

Viewing 17 reply threads

The support post ‘Styling Venue Manager’ 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