Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi there,
Is there anyway in which I can force the Marinelli banner url links to open up in a new window - target="_blank" ?
Many thanks in advance for your help
Maxplay
Comment | File | Size | Author |
---|---|---|---|
#8 | patch-marinelli.png | 12.08 KB | Premanshu |
#6 | 1122524-5.patch | 512 bytes | djsagar |
Comments
Comment #1
maxplay CreditAttribution: maxplay commentedComment #2
Deepika.chavan CreditAttribution: Deepika.chavan commentedHi,
I tried the same thing on my local site.
1. I added following line in template.php after
include_once('logics/banners.inc');
line:2. Added following code in myjs.js file (path- /themes/marinelli/myjs.js):
3. Cleared cached data.(here-'admin/config/development/performance').
Rgrds,
Deepika chavan.
Comment #3
maxplay CreditAttribution: maxplay commentedFantastic Deepika - it worked :-)
Just one little comment for other users:
I am using Drupal 7 together with the Marinelli 7.x template.
In this version, the JS file which has to be modified is as follows:
/themes/marinelli/js/marinelli_marinelli.js
I also modified the template.php script to address this location:
drupal_add_js(drupal_get_path('theme', 'marinelli') . '/js/marinelli_marinelli.js');
Otherwise just do what Deepika suggested and it works.
I hope this all makes sence - otherwise please correct me.
Many thanks again Deepika
Maxplay
Comment #4
CarlosSR CreditAttribution: CarlosSR as a volunteer commented(five years later)
Fantastic! it works perfectly.
But in my carousel banner there are external and internal links.
I wish that external links open a new tab, and internal do not.
How could I do it?
Thanks for helping!
Comment #5
djsagar CreditAttribution: djsagar at OpenSense Labs commentedHi Deepika,
Code is working which you are sharing just created patch for your code in 7.x-4.x Version and change the status for knowledge who had facing this issue.
With help of this page or status change they can resolved there issue.
Thanks!
Comment #6
djsagar CreditAttribution: djsagar at OpenSense Labs commentedPatch for 7.x-4.x Version.
Comment #7
djsagar CreditAttribution: djsagar at OpenSense Labs commentedComment #8
Premanshu CreditAttribution: Premanshu as a volunteer and at OpenSense Labs commentedThis patch applies cleanly.
Comment #10
gaurav.kapoor CreditAttribution: gaurav.kapoor commentedComment #11
gaurav.kapoor CreditAttribution: gaurav.kapoor commentedBy default, there will be a link opening in a new tab. In case someone has internal links as well, they will have to add appropriate JS code.
Comment #12
Deepika.chavan CreditAttribution: Deepika.chavan commentedHi,
Below js code may help to open only external links in new tab.
Regards,
Deepika