J and Beyond 2013 | An International Joomla! Conference - May 31st - 2nd, 2013, Noordwijkerhout, The Netherlands
It is currently Sun May 19, 2013 11:52 am

SOLVED - location link in a new window

Discuss JEvents 2.x for Joomla 1.5-2.5 here - club members can use the special club forum for faster response times.
Forum rules
When requesting support, please copy and paste the 'Version information for Support Forum' from the JEvents Control Panel into your post. If you cannot see this, please enable JEvents project news within it's configuration. Also, if you get a 500 Error, Enable Joomla! Maximum Error Reporting and view the page again, you should now have a more detailed error which will help us to resolve you issue quickly.

SOLVED - location link in a new window

Postby howie » Wed Mar 14, 2012 5:59 pm

Hello,
is it possible to add a _blank-tag to the url of the location-link on the details-page to let it open in a new window?
Greetings
Howie
howie
Posts: 11
Joined: Wed Nov 09, 2011 5:00 pm
Location: Hildesheim

Re: location link in a new window

Postby Tonyp » Wed Mar 14, 2012 9:32 pm

Hello,

Can you be a bit more specific? location page? are you using the Managed Locations addon?

Regards
Tony
---------------------------------------

Do not forget if you like JEvents, why not join the CLUB! for priority support and lots of excellent plugin's. JEvents Club
User avatar
Tonyp
Contributor
Posts: 8717
Joined: Tue Oct 12, 2010 9:12 pm
Location: Isle of Man

Re: location link in a new window

Postby howie » Wed Mar 14, 2012 10:10 pm

Hi Tony,
thanx for your fast response!
I mean the link to the website of the events location.
example: http://www.fan.bluesshacks.de/index.php ... -bluesclub
the link after "Contact".
Best
Howie
howie
Posts: 11
Joined: Wed Nov 09, 2011 5:00 pm
Location: Hildesheim

Re: location link in a new window

Postby Tonyp » Wed Mar 14, 2012 10:21 pm

Hello Howie,

So you are wanting to make the Location a link? to what exactly? we have a Locations Plugin which allows you to define locations in google, click the map or showing the link can open a new tab.

Regards
Tony
---------------------------------------

Do not forget if you like JEvents, why not join the CLUB! for priority support and lots of excellent plugin's. JEvents Club
User avatar
Tonyp
Contributor
Posts: 8717
Joined: Tue Oct 12, 2010 9:12 pm
Location: Isle of Man

Re: location link in a new window

Postby carcam » Thu Mar 15, 2012 6:14 am

Hi howie,
to make that link open in a new window you should modify the file [JOOMLA]/components/com_jevents/libraries/datamodel.php

and around line 736 replace this code:

Code: Select all
$row->extra_info(preg_replace('#(http://)('.$pattern.'*)#i', '<a href="\\1\\2">\\1\\2</a>', $row->extra_info()));


with this:
Code: Select all
$row->extra_info(preg_replace('#(http://)('.$pattern.'*)#i', '<a href="\\1\\2" target="_blank">\\1\\2</a>', $row->extra_info()));


Remember the code for future upgrades as it will be overwritten if you upgrade the component.
carcam
Contributor
Posts: 3391
Joined: Wed Aug 06, 2008 7:50 pm
Location: Córdoba

Re: location link in a new window

Postby howie » Thu Mar 15, 2012 9:34 am

Hi Carcam,
this worked for me - but I had to add the _blank-tag in the contact-line!
Thanks for your help!
cheers
Howie
howie
Posts: 11
Joined: Wed Nov 09, 2011 5:00 pm
Location: Hildesheim

Re: SOLVED - location link in a new window

Postby carcam » Fri Mar 16, 2012 6:51 am

Just extend the idead to the other fields.

All best!!
carcam
Contributor
Posts: 3391
Joined: Wed Aug 06, 2008 7:50 pm
Location: Córdoba

Re: SOLVED - location link in a new window

Postby uqkhurle » Thu Nov 08, 2012 1:18 am

Hello carcam, thanks for this exactly what I needed. However, this only seems to work when I open the event, then click on the extra_info field. If I click on the extra_info field when viewing an event through the See By Year view, which is my default, the URL still opens in the same window. Do I need to at the _blank code to another file somewhere? Many thanks,K
uqkhurle
Gold Members
Posts: 8
Joined: Wed Sep 19, 2012 9:26 am

Re: SOLVED - location link in a new window

Postby Geraint » Thu Nov 08, 2012 9:07 am

That is correct - Carlos' change only affected the event detail page. You can do the same for your list views but they need a different approach.

Are you using the layout editor (http://www.jevents.net/jevents-15-topme ... ut-editing)? If you are then copy the file components/com_jevents/views/default/helpers/defaultloadedfromtemplate.php to templates/YOURTEMPLATE/html/com_jevents/helpers/defaultloadedfromtemplate.php and edit the copied file.

In this at line c. 250 you'll find
Code: Select all
$search[]="{{EXTRAINFO}}";$replace[]=$event->extra_info();$blank[]="";


replace it with
Code: Select all
         if (strpos($row->extra_info(),'<a href=')===false){
            $row->extra_info(preg_replace('#(http://)('.$pattern.'*)#i', '<a href="\\1\\2" target="_blank">\\1\\2</a>', $row->extra_info()));
         }


If you do this then you can undo the change in the datamodel.php file since this change will affect the event detail and event list views.
------------
JEvents club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits.

Join the JEvents club today!
User avatar
Geraint
Posts: 30518
Joined: Fri Feb 15, 2008 6:14 pm


Return to Jevents 2.x (Free Access)

Who is online

Users browsing this forum: Google [Bot]

Main Menu

User Menu

Hosted By


Who is online

In total there is 1 user online :: 1 registered and 0 hidden (based on users active over the past 5 minutes)
Most users ever online was 94 on Tue Sep 01, 2009 12:33 am

Users browsing this forum: Google [Bot]

Login Form