Support

Home Forums Event Espresso Premium Grid View – Available places

Grid View – Available places

Posted: May 5, 2017 at 8:23 am


Bosworthsgc

May 5, 2017 at 8:23 am

Hi

One the grid view plugin, is it possible on hover over to show the available places as well as the event title etc

Thanks


Josh

  • Support Staff

May 5, 2017 at 8:55 am

Hi Jonathan,

You’ll find some example code with instructions in the documentation:

https://eventespresso.com/wiki/events-grid-view-template-add-on/#ee4customizations


Bosworthsgc

May 5, 2017 at 9:00 am

Thanks Josh

Would I add this into a site specific plugin that I have created?

Just a little confused as to where I place the $remaintext then?

Thanks
Jonathan


Josh

  • Support Staff

May 5, 2017 at 9:37 am

Hi Jonathan,

The documentation says:

You can display the available spaces in the EE4 grid template by copying the
espresso-grid-template.template.php file to your active WordPress theme.
Then you copy this code into the template just after the $datetime variable is defined:

and

Then you add this code to the template to the spot where you want the tickets remaining message displayed:
echo '' . $remaintext . '';

I can show you exactly where to put the $remaintext code if you know where you want the text to be displayed.


Bosworthsgc

May 5, 2017 at 9:40 am

Hi Josh

I would just want it underneath all the default text that is already there on the grid.

Do I need to copy the espresso-grid-template.template.php code into the site specific plugin that i created?

Thanks
Jonathan


Josh

  • Support Staff

May 5, 2017 at 9:56 am

Then you put
echo '' . $remaintext . '';
below the line of code that has:
echo '<strong class="button-text">' . $button_text . '</strong>';

Do I need to copy the espresso-grid-template.template.php code into the site specific plugin that i created?

No. You copy the entire file (espresso-grid-template.template.php) and put it into your active WordPress theme folder.


Bosworthsgc

May 8, 2017 at 2:39 am

Hi Josh

Can I just confirm

The line of code starting echo”<stong……

Is this within the espresso-grid-template.template.php? So I basically copy this over and add that line underneath?

The entire file, do I just literally copy that into the theme folder – does it need to go in a subfolder or in the root of the theme folder?

Thanks – sorry just not completely understanding it


Josh

  • Support Staff

May 8, 2017 at 9:35 am

The line of code starting echo”

Yes. That’s line 63.

The entire file, do I just literally copy that into the theme folder – does it need to go in a subfolder or in the root of the theme folder?

Yes you copy the entire template file into the root of the theme folder.


Bosworthsgc

May 15, 2017 at 9:09 am

Hi Josh

There is no exact match on line 63 as above – this is where I have put it within the code but it doesn’t appear to be working

echo ‘<b class=”title”>’ . $post->post_title. ‘</b><br />’;
/*if($event->event_cost === “0.00”) {
echo __(‘FREE’, ‘event_espresso’);
}else {
echo $org_options[‘currency_symbol’] . $event->event_cost;
}*/
echo ‘<br />’;
echo ‘<b class=”start-date”>’ . $startdate . ‘</b>’;
echo ‘<br /><br />’;

echo ‘<b class=”button-text”>’ . $button_text . ‘</b>’;
echo ” . $remaintext . ”;

Thanks
Jonathan


Tony

  • Support Staff

May 15, 2017 at 10:46 am

This code:

echo '' . $remaintext . '';

Should actually be:

echo '<strong>' . $remaintext . '</strong>';

I’d recommend adding a br at the begging to make sure the text is on its own line:

echo '<br/><strong>' . $remaintext . '</strong>';

The wiki posts needs updating to prevent the browser from parsing the strong tags in the example.

The above won’t fix the problem if its not working but you’ll need it anyway.

Did you add the code to generate the $remaintext variable before using the above to use it? It should look something like this – http://take.ms/bvWdv


Bosworthsgc

May 16, 2017 at 2:41 am

Thanks Tony

Its now working


Tony

  • Support Staff

May 16, 2017 at 4:26 am

You’re most welcome.

The support post ‘Grid View – Available places’ 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