Jevents 2.x (Free Access)

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 follow these steps:

1. Update all JEvents add on's first, via the Joomla! Updater
2. Copy and Paste the JEvents Support Information from the JEvents Control Panel.
3. If you get a 500 error OR white page, enable Maximum Error Reporting in Joomla! Global Config and visit the page again, this should give you a more detailed error and help us provide a prompt response.

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

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
---------------------------------------
Feel free to PM me if you would like Custom Installs or Joomla! related work for a competitive quote.

User avatar
Tonyp
Team Staff
 
Posts: 23790
Joined: Tue Oct 12, 2010 9:12 pm
Location: Isle of Man

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

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
---------------------------------------
Feel free to PM me if you would like Custom Installs or Joomla! related work for a competitive quote.

User avatar
Tonyp
Team Staff
 
Posts: 23790
Joined: Tue Oct 12, 2010 9:12 pm
Location: Isle of Man

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.
¿Sabías que tenemos soporte en español para los miembros del Club de JEvents? ¡ÚNETE AHORA!
User avatar
carcam
Team Staff
 
Posts: 7111
Joined: Wed Aug 06, 2008 7:50 pm
Location: Almería

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

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

Just extend the idead to the other fields.

All best!!
¿Sabías que tenemos soporte en español para los miembros del Club de JEvents? ¡ÚNETE AHORA!
User avatar
carcam
Team Staff
 
Posts: 7111
Joined: Wed Aug 06, 2008 7:50 pm
Location: Almería

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
 
Posts: 8
Joined: Wed Sep 19, 2012 9:26 am

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: 42811
Joined: Fri Feb 15, 2008 6:14 pm


Return to Jevents 2.x (Free Access)

  • Who is online
  • View new posts
  • View unanswered posts
  • 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: Yahoo [Bot]