Support

Home Forums Event Espresso Premium Manual Links in Event Titles

Manual Links in Event Titles

Posted: August 18, 2014 at 5:11 am


Alexander Müller

August 18, 2014 at 5:11 am

hey!
I’m trying to put some links manual in the event title field – like it’s possible, for example, for wordpress pages. I want link to different pages and NOT to the event-details.

the event title should be something like “Event One <a href="url">Details</a> ” so that there’s a “Details”-Link in the table and on other sites.

Unfortunately, if I add these links and refresh the event, all html-tags are removed from the title and only the word “detail” is left.

Is there a way to change the files, that html-tags WON’T be removed from event-titles?


Dean

August 18, 2014 at 6:28 am

Hi Alexander,

I’m assuming this is for EE3? If not please let me know.

I am also assuming you want these to be shown on the event list rather than the event itself, though the process is similar.

In EE3 you can copy the /templates/event_list.php and /templates/event_list_display.php files over to wp-content/uploads/espresso/templates.

Copying them there allows you to edit them without the edits being over writen on update.

From there you would need to edit the event_list_display.php file.

You will see on line 43 this:

" class="a_event_title" id="a_event_title-" href="">

That can be edited to change the event title within the event list. Just adding

 - Details

after that should give you what you want, if I have understood your query correctly: screenshot http://take.ms/Simam

Hope that helps.


Alexander Müller

August 18, 2014 at 6:42 am

Hi Dean!
Thanks for the quick response, but it’s not exactly what I want.

If I put the link in the template files, I would have the SAME link on all events. What I want is, that i can add the link in the EVENT NAME field, when I’m creating a new event.

For example: If you create a new wordpress page or article, you can easily put some html-tags inside the title-field. If I put html tags inside the event-name field and create the new event, the html-tags are removed.

I only need a way, that the event-title-field WON’T remove the links that I enter!

thanks and br!


Dean

August 18, 2014 at 6:58 am

Hi,

Thank isn’t possible I’m afraid, we strip HTML out.

Even in a standard WP post, while HTML is allowed, links will simply break as they conflict with the Permalinks.

You could instead create a function that pulls in a custom meta field and appends it to the title.

As EE3 doesn’t use custom post types, you would need to do it in the template files, but that would allow you to set the URL from within the post (or not) rather than hardcoding things.


Alexander Müller

August 18, 2014 at 7:13 am

It would be no problem for me to change the template files – I had to change so much in the core-files 😉

In a normal wordpress article, html is allowed in the titles. I’ve just created a small demo: http://www.alexander-mueller.at/fotokurse/textlink-details/.
If you hover on “Details” in the link, it’s a working html-link.

Isn’t there a way to “deactivate” the function, that strips out the html in the event-titles? It’s no problem if the link would be everywhere the event-title is placed (for example on the booking page, calendar, and so on).

Again, I’m not afraid to delete a small part of the core-file 🙂

thanks!


Dean

August 18, 2014 at 8:38 am

Hi,

The HTML is allowed, but the link is broken (http://www.alexander-mueller.at/fotokurse/textlink-details/www.text.com).

Anyway, though I strongly advise against it, you can find the code that sanitises the title in

/wp-content/plugins/event-espresso/includes/event-management/insert_event.php
/wp-content/plugins/event-espresso/includes/event-management/update_event.php

sanitize_text_field($_REQUEST[‘event’]) is what will need to be changed.

Hope that helps.


Alexander Müller

August 18, 2014 at 8:55 am

thanks for the advice! worked for me 🙂
just one more thing: it looks like, the event-title has a maximum space of letters… is it possible to deactivate this?

thanks!


Josh

  • Support Staff

August 18, 2014 at 6:59 pm

Hi Alexander,

You can change this directly in the database using PHPmyadmin.

The support post ‘Manual Links in Event Titles’ 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