Page 1 of 1

Link List plugin - custom target per entry?

Posted: Wed Oct 26, 2005 1:42 am
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

Re: Link List plugin - custom target per entry?

Posted: Wed Oct 26, 2005 10:50 am
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

Posted: Thu Oct 27, 2005 5:58 am
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.

Posted: Thu Oct 27, 2005 5:05 pm
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!

Posted: Thu Oct 27, 2005 9:43 pm
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 ;)

Posted: Thu Oct 27, 2005 11:55 pm
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?

Posted: Fri Oct 28, 2005 11:12 am
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