Support

Home Forums Event Espresso Premium EE4 list view – extract content & block height

EE4 list view – extract content & block height

Posted: November 7, 2016 at 3:24 pm

Viewing 7 reply threads


jbbruning

November 7, 2016 at 3:24 pm

Hi there.

Hope you can help. I have my events on my homepage as a list (actually in a horizontal grid) which includes image, title, date, description, book button. However due to the each event having specific copy, there are differences in column height (even with a max number of words set).

My solution is to use “display:flex” as a means of giving this part of the grid uniformity, BUT due to the presence of the “(more…)” link sitting within the paragraph tags it’s breaking content over 2 columns.

So my request is to move the “(more…)” link outside of the extract paragraph, but i can’t see how to do this as it looks like its not part of the templating files, but within core files which i don’t believe are editable. Is that correct?

Any advice here on how to make granular changes to sections of the Event Espresso output would be much appreciated.

Thanks in advance.


Josh

  • Support Staff

November 8, 2016 at 2:28 pm

You wouldn’t necessarily need to look at editing a core file if there’s a filter in the plugin that can be used to make the change you’re looking to make. Since it’s not clear how exactly your home page template is getting the event information that it’s displaying, which will help us know where to look in the code, can you post a gist or paste bin of that template code, then link here?


jbbruning

November 8, 2016 at 5:02 pm

Hi Josh,

At present event content is loading using the shortcode [esspresso_events] as it’s only a small section of the a bigger page. So using the out-the-box templates.

See https://portal1.anzcp.org.au/ for how it works.

However i can’t see how and where i can make direct changes to the extract content as the code is not present on any template, and guessing injected from another files somewhere. Same goes for other content which i’ve hidden using CSS and adapted some code where i can within functions.php

At present i’m having to manually set heights in CSS for the extract content which for response use is not efficient. It’s a band-aid fix currently, but will need to split out the extract copy paragraph from the “(more…)” link that appends it.

Does that make more sense?

If i can setup a new template with the flexiblity of changing blocks of content at a micro-level that would be terrific, but i can only really see how to re-layout blocks vs. changing content within those blocks. I might be missing something though.

Thanks again.


Josh

  • Support Staff

November 9, 2016 at 3:54 pm

So the template that’s used for that part of the display is the
content-espresso_events-details.php
template. You can look in this template’s code and see that there are action hooks before and after where it adds the extract paragraph, and there’s a filter hook in there too.

So for example, you can remove that more link by adding the following to your functions.php file:

add_action( 'AHEE_event_details_before_the_content', 'my_custom_event_content' );
function my_custom_event_content() {
    add_filter( 'the_content_more_link', '__return_false' );
}


jbbruning

November 10, 2016 at 3:24 am

Hi Josh,

Thanks for the function. Is there a repository to show these and other filters?

In this instance I’m actually looking to move the content_more_link outside of the extract content paragraph tags, as it currently sits within the <p>extract blurb (more…[link])</p>

Would be great to know where to find all the filters though, if available to view.


Josh

  • Support Staff

November 10, 2016 at 9:35 am

You can find all of the filters by loading up the EE plugin in an IDE or code editor. I’m afraid that a list of filter hooks taken out of their context from the code they belong too would be of little value.

So for the specific task of adding the more tag to a later point, you’ll look in the content-espresso_events-details.php template, where you’ll see the AHEE_event_details_after_the_content action hook. That’s a good place to add a new (more…) link.


jbbruning

November 10, 2016 at 9:45 pm

Hi Josh

Probably missing something pretty obvious (it’s Friday afternoon afterall), but I don’t see anywhere in that template file that references the filter called “the_content_more_link” so where would i find this if i’d not asked? I can see the hook which is great, but surely the filter sits somewhere.

Sorry for all the questions.

Cheers


Tony

  • Support Staff

November 11, 2016 at 7:36 am

Event Espresso injects the event details into ‘the_content’.

the_content is a core hook within WP – https://developer.wordpress.org/reference/functions/the_content/

‘the_content_more_link’ is also a core hook within WP – https://developer.wordpress.org/reference/hooks/the_content_more_link/

When you run the_content() it runs both of the above filters.

Event Espresso posts are custom post types so can be used as any ‘normal’ post within WP (although we do use custom tables we add the EE_Event object to the post for espresso_event post types), so in this case you’d find something like this:

https://codex.wordpress.org/Customizing_the_Read_More

The point within the above template file that runs those filters is the espresso_event_content_or_excerpt( 55, null, false ) function, which eventually builds out an excerpt or posts the content, both of which run the the_content_more_link filter.

Viewing 7 reply threads

The support post ‘EE4 list view – extract content & block height’ 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