External links to open in new window
External links to open in new window
I'd like to open up all links inside entries or comments to a new window (target="_blank" or something like that)
Where do have to make the code changes?
Where do have to make the code changes?
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: External links to open in new window
Inside entries, you need to specify it in your text you write.
For comments, you need to edit 'comments.tpl' in the templates/default folder for Serendipity 0.8. In Serendipity 0.7, changing this is not recommended.
Regards,
Garvin
For comments, you need to edit 'comments.tpl' in the templates/default folder for Serendipity 0.8. In Serendipity 0.7, changing this is not recommended.
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: External links to open in new window
If I click the "Link" button inside the entry editor it generates the html code automatically. Instead adding the target="_blank" command manually I prefer the idea that some code change could do this by default.garvinhicking wrote:Inside entries, you need to specify it in your text you write.
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: External links to open in new window
Ah, okay - I see. I think that code is created in serendipity_editor.js
Regards,
Garvin
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
- Regular
- Posts: 12
- Joined: Sat Jan 01, 2005 8:30 pm
- Location: Enschede, The Netherlands
- Contact:
Re: External links to open in new window
I wanted the same thing. You should indeed edit serendipity_editor.js (in the root of your serendipity) and edit line 69. Change this togarvinhicking wrote:Ah, okay - I see. I think that code is created in serendipity_editor.js
Regards,
Garvin
lft = "<a href="" + my_link + "" target="_blank">";
modifying anchor attributes...
Hi,
While reading this, it looked like that would be a nice hook to add to the plugin system. Maybe it already exists, but basically like they do for changing acronyms into links, they should also have post-processing event on link creation that would allow such manipulation.
An example could also be to remove specific tag or add a class statement to each <p> elements... etc. Just ideas.
While reading this, it looked like that would be a nice hook to add to the plugin system. Maybe it already exists, but basically like they do for changing acronyms into links, they should also have post-processing event on link creation that would allow such manipulation.
An example could also be to remove specific tag or add a class statement to each <p> elements... etc. Just ideas.
Yannick Koehler
hyperlink event plugins
Hi,
I just realized that by having such an event pluggable for hyperlink one could then implement in the same way as the "target='_blank'" the google 'nofollow' attribute.
An interface for the event would include information such as the link is pointing inside the site or externally, where that link came form, article, comment or layout. And a table containing the already specified attributes such as target, nofollow, class and others.
I just realized that by having such an event pluggable for hyperlink one could then implement in the same way as the "target='_blank'" the google 'nofollow' attribute.
An interface for the event would include information such as the link is pointing inside the site or externally, where that link came form, article, comment or layout. And a table containing the already specified attributes such as target, nofollow, class and others.
Yannick Koehler
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: hyperlink event plugins
Hi Yannick!
Well, we do already have a plugin called "Fix common XHTML errors" which does tricks like that, to rewrite HTML tags.
And, of course, you could even use the content rewrite plugin to change '<p>' into '<p class="mine">'...
However I think you're more requesting an interface for this, right? How would you think that could look like? Last week I just created a "dynamiclinks" plugin which uses tags like {dynamic_link:img:X} to insert an image Number #X from the media libary. The good thing to use this dynamic variable is that if you rename the image in the media library, it will always show the latest path. But I don't really know how to build an interface for what you need. Could you create some fake screenshots or whatever, on how you imagine it to be?
Regards,
Garvin
Well, we do already have a plugin called "Fix common XHTML errors" which does tricks like that, to rewrite HTML tags.
And, of course, you could even use the content rewrite plugin to change '<p>' into '<p class="mine">'...
However I think you're more requesting an interface for this, right? How would you think that could look like? Last week I just created a "dynamiclinks" plugin which uses tags like {dynamic_link:img:X} to insert an image Number #X from the media libary. The good thing to use this dynamic variable is that if you rename the image in the media library, it will always show the latest path. But I don't really know how to build an interface for what you need. Could you create some fake screenshots or whatever, on how you imagine it to be?
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: hyperlink event plugins
Hi Garvin,
If the Fix common XHTML errors plugin does that then maybe it should be named in a more generalized way or available under a new name as well as dk is definitely not fixing a tag to be XHTML compliant.
If something new is needed then I may not be the proper person to define in details the proper API for it as I have yet to start playing with the plugin interfaces. Still the elements I pointed out should be accessible from that interface in my opinion.
I am not sure if I was requesting something new. As I said, I don't know if something already exists that could do as dk requested. I was just pointing out that instead of fixing serenditpity_*.php files as SurfDude proposed, some kind of post-processing plugin system should be used or implemented so that whenever people want to do stuff like that they don't need to change the core php files.garvinhicking wrote: However I think you're more requesting an interface for this, right? How would you think that could look like?
If the Fix common XHTML errors plugin does that then maybe it should be named in a more generalized way or available under a new name as well as dk is definitely not fixing a tag to be XHTML compliant.
If something new is needed then I may not be the proper person to define in details the proper API for it as I have yet to start playing with the plugin interfaces. Still the elements I pointed out should be accessible from that interface in my opinion.
Yannick Koehler
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: V0.9
mama99de, please describe what you mean/want exactly.
Regards,
Garvin
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: V0.9
I tried this :garvinhicking wrote:mama99de, please describe what you mean/want exactly.
...and edit line 69. Change this to
lft = "<a href="" + my_link + "" target="_blank">";
I think it´s line 80 in version 0.9 but it doesn´t work...
All links in a blog should open in a new browser window.
Regards
Marcus
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: V0.9
Hm, I still don't know what you want to do. You want to make all images open in a new browser window?
Install the serendipity_event_imageselectorplug plugin, this offers you to tell what "target" should be used for images...?!
Or please describe more datiled what you want to do/have, we also have a german forum.
Regards,
Garvin
Install the serendipity_event_imageselectorplug plugin, this offers you to tell what "target" should be used for images...?!
Or please describe more datiled what you want to do/have, we also have a german forum.
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/