- This topic has 4 replies, 2 voices, and was last updated 13 years, 7 months ago by .
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘How do I …’ is closed to new topics and replies.
Events Made Easy › Forums › How do I … › #_LINKEDNAME in a new window when using External link
Tagged: #_LINKEDNAME, external link, new window, url
Hello Franky,
Great work!! I want to say this is the most enjoyable plug-in I have worked with since starting with WordPress 🙂 thank you!!
I have a small enhancement might be useful for someone
Because the placeholder #_LINKEDNAME does not distinguish between normal event or an event with an external link pointing to an external URL and I really hate my visitors to leave my website too soon I replaced the following in events-manager.php :
} elseif (preg_match('/#_LINKEDNAME$/', $result)) {
$event_link = eme_event_url($event);
$replacement="<a href='$event_link'>".eme_trans_sanitize_html($event['event_name'])."</a>";
with this:
} elseif (preg_match('/#_LINKEDNAME$/', $result)) {
$event_link = eme_event_url($event);
if($event['event_url'] != '')
$replacement="<a href='$event_link'>".eme_trans_sanitize_html($event['event_name'])."</a>";
else
$replacement="<a href='$event_link'>".eme_trans_sanitize_html($event['event_name'])."</a>";
now when you are using the External link feature, the link will open in a new window otherwise will open in the same window in your browser.
cheers!
Samo
Don’t do that, just use the #_EVENTPAGEURL placeholder and build your own link with it, eg. in the event format setting:
<a href=#_EVENTPAGEURL target=_new>#_NAME</a>
why what’s wrong u scared me actually :/
The thing is when I use <a href="#_EVENTPAGEURL" target="_new">#_NAME</a>
in events list formt it’s gonna open all events in a new windows. I do not want that I just want events with an external link to do that.
Is there something I don’t understand?
Then use an attribute to indicate you want an external link and use a conditional tag to test for the value of it.
If you change the code, upgrades are going to be more difficult later on …
Ok, this is not bad.
Thank you Franky you are great!
for now I’m gonna use it like this But I would like to have a checkbox for the External link to do that in the future at least.(please 🙂 )
Thank you two times more.
Samo