Support

Home Forums Event Espresso Premium Customising text on grid view

Customising text on grid view

Posted: April 19, 2015 at 4:21 pm

Viewing 5 reply threads


Nick

April 19, 2015 at 4:21 pm

I’m wondering if there is any way of customising the text on the grid view, e.g. adding the town of the event, or removing the time and just having the date.

Also I would like to add some text beneath each grid corresponding to the event (this again could be the town, or the title of the event). Is this possible?

Thanks

Nick


Tony

  • Support Staff

April 20, 2015 at 5:24 am

Hi Nick,

It is possible to modify the templates yes.

If you go to \ee4-grid-template\templates\

You will find the file espresso-grid-template.template.php

Copy that file to wp-content\upload\espresso\templates\

That will replace the original template file with your custom one. You can then edit that file to include (or remove any information you prefer).

We do not provide customisations on the forum, but we can help point you in the right direction.

Within that file on line 62 you’ll fine something like this:

echo '' . date_i18n( $date_format . ' ' . $time_format, strtotime( $startdat ) ) . '';

Change that to

echo '' . date_i18n( $date_format, strtotime( $startdat ) ) . '';

Which will remove the time from the output.

Adding text in the template depends on exactly what you want to add?


Nick

April 20, 2015 at 3:34 pm

Thanks Tony. I have removed the time. Now I would like to show the town for the venue for the event below each image. So I would need to know what code to use to display the town, and also I suppose edit the CSS for each grid to allow space for text for the town below each image.


Tony

  • Support Staff

April 21, 2015 at 8:04 am

Hi Nick,

We don’t provide customisations services over the forums, however we can point you in the right direction.

For each event you can pull in the assigned venue using:

$venue = $post->EE_Event->venues();
$venue = !empty( $venue ) ? array_shift( $venue ) : NULL ;

Then as an example, to display the venue name and city you can use:

if ($venue instanceof EE_Venue) { 
	echo $venue->name();
	echo '
'; echo $venue->city(); echo '

'; }

Like this – http://take.ms/o1S4D

Will output something like this – http://take.ms/J3T0p


Nick

May 4, 2015 at 9:57 am

Thanks Tony. I have this working well now. I have also added the following to espresso-grid-template.template.php to get a box above the image with text:

<div class="grid-title">
		<?if ($venue instanceof EE_Venue) { 
			  echo $venue->city();
}?>

I added this just below this code:

<a id="a_register_link-<?php echo $post->ID; ?>" href="<?php echo $registration_url; ?>" class="darken">

You can see the results on this page: http://opendialogueapproach.co.uk/summer-seminars-2015/

I think it would be good to introduce this option as standard, as in this way you don’t have to have text embedded into the images used in the grid – you can just use images. Of course there is text when the image is hovered over, but I think it can be confusing to the user to know which box to click on in the absence of any text. I hope this makes sense!


Dean

May 5, 2015 at 3:20 am

Hi Nick,

Glad you got it up and running and thanks for the feedback, I’ll add it to our feature request list!

Viewing 5 reply threads

The support post ‘Customising text on grid view’ 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