Link List plugin - custom target per entry?

Creating and modifying plugins.
Post Reply
cstorer

Link List plugin - custom target per entry?

Post by cstorer »

Is there a way that i can specify, per link entry, how it should be opened? I.e., _self , _blank , etc.

I know this can be specfied globally for all links, but I'd like an extra tag in the xml to specify target per link entry...

Is this possible?

Thanks!

Regards,

Chris
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Link List plugin - custom target per entry?

Post by garvinhicking »

Hi!

Currently the XML parser does not take care of XML attributes, so it would require a larger patch to the plugin to support that. Maybe the plugin authors can patch that, but it definitely is a larger bit of work.

It's definitely possible, though! :)

Best 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/
oxygenws
Regular
Posts: 148
Joined: Thu Jan 20, 2005 11:20 am
Location: Iran
Contact:

Post by oxygenws »

We could add this feaure, but really it is needed?
it well be hard to add links and set its target.... for each link.
My Blog, powered by s9y is http://oxygenws.com/blog/
cstorer

Post by cstorer »

oxygenws wrote:We could add this feaure, but really it is needed?
it well be hard to add links and set its target.... for each link.
Well, I personally have a use for it, but I wouldn't consider that as neccesarily being needed :D

Maybe there could be a default if target isn't defined within the link? So you could set the global option like current, but you could add the target tag if you wanted something other than default...

Not a huge deal, and not sure if anyone else in the world besides myself would use it. Just a thought.

Thanks!
oxygenws
Regular
Posts: 148
Joined: Thu Jan 20, 2005 11:20 am
Location: Iran
Contact:

Post by oxygenws »

Maybe there could be a default if target isn't defined within the link? So you could set the global option like current, but you could add the target tag if you wanted something other than default...
Nice :)
I'll add this issue ;)
My Blog, powered by s9y is http://oxygenws.com/blog/
oxygenws
Regular
Posts: 148
Joined: Thu Jan 20, 2005 11:20 am
Location: Iran
Contact:

Post by oxygenws »

There is a problem with your request and another friends request in the followind link:
http://www.s9y.org/forums/viewtopic.php?t=1796&start=30

for his request i need to change "<a href=...." to "<a onclick=\"window.open....." to CAN set width and height of new pages (this works fine, now)
but how can i add TARGET to this feature?!

i think window.open ALWAYS opens a new window, not self nor parent nor ...

do you have any suggestion for it?
My Blog, powered by s9y is http://oxygenws.com/blog/
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

You can assign a variable to windows:

Code: Select all

<script type="text/javascript">
windowCache = new Array();
function cacheWin(target, href) {
  if (cacheWin[target]) {
    cacheWin[target].location.href = href;
  } else {
    cacheWin[target] = window.open(target, href);
  }
}
</script>
<a href="http://www.s9y.org" onclick="cacheWin('<?php echo $target; ?>', this.href); return false">Link</a>
O rsomething like that. The window.open assigns a window name, and a var is also returned for the window handle which you can reuse to later open windows.

However once you leave the parent page, the javascript looses its values, unlike the "target"-attribute mechanism which allows you to open up URLs in a targetted page even if you change the originating page.

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/
Post Reply