Comments

dawehner’s picture

Status: Active » Needs review

here is a little typing mistake

+        'blank' => array('defautl' => FALSE),

Generall comment to _blank, if you use it you loose xhtml strict see http://www.w3.org/TR/xhtml1/

merlinofchaos’s picture

Status: Needs review » Needs work

How can we make this XHTML strict compliant?

dawehner’s picture

as far as i know you cannot do this with target.

there could be an extra link class, and a extra js file using this, but should this really be part of views?

Steve Dondley’s picture

to make it xhtml strict you'd need external js.

Why shouldn't this be part of views? It would be real hassle to have to install yet another module for such a basic feature.

merlinofchaos’s picture

I'm really hesitant to add something that won't validate XHTML strict. Every time something doesn't validate, there's a flood of issues about it...

AlexisWilke’s picture

Status: Needs work » Needs review

Steve Dondley,

Thank you for the patch! Way cool! I needed that feature and was not appealed at the idea of digging in the Views code.

I created a patch that (1) has a WARNING about the fact that this feature is totally non-XHTML and will totally break the whole entire site, mamamia! That should prevent 90% of the issues in that regard [maybe], (2) has the correct "default" spelling.

Now my patch is against 2.6 and not 2.x-dev... It seems a few other things have changed already!

Thank you.
Alexis Wilke

dawehner’s picture

StatusFileSize
new2.41 KB

Here is a new patch which does not brake xhtml, it just uses a little bit js together with a class.

AlexisWilke’s picture

I missed adding my patch it looks like... 8-P

Note that I still don't understand how useful it could possibly be to add a link with a hard coded path in a list of items. So I actually cannot use that patch. I needed the same to work for the "Display as link" instead so I could have a useful link + target="_blank".

There is a version that is not XHTML but works on all browsers (whereas JS code does not work on all browsers.) That's my personal recommendation on that one ... 8-)

Of course, we could test whether JS is turned on and if not do the ugly work of using XHTML. But that's a lot of work for not much reward...

Thank you.
Alexis Wilke

P.S. sample of aggregator links here: http://dscam.m2osw.com/ (Cybercrime list at the top-left)

dawehner’s picture

Note that I still don't understand how useful it could possibly be to add a link with a hard coded path in a list of items. So I actually cannot use that patch. I needed the same to work for the "Display as link" instead so I could have a useful link + target="_blank".

You can use for example a nid field, and a title field, and build together a link to the node using node/[nid] in link settings of the title.

There is a version that is not XHTML but works on all browsers

How many browsers do have JS enabled, i guess its not a lot.

To your patch: There is a currently a target field, I don't understand why to add another one

AlexisWilke’s picture

Dereine,

In most cases, I have not seen the [nid] field, only the [title] of the object (node, aggregator item, etc.) which is why I'm wondering about that. I guess I need to add something more to my list of fields and hide it from view... 8-)

> To your patch: There is a currently a target field, I don't understand why to add another one

I'm not too sure I understand your question.

There are 3 locations where there was no target field, or maybe it is already available in 2.x-dev? I run with 2.6...

I actually put a patch that enables any valid entry in the target as per HTML 4.

merlinofchaos’s picture

I would rather go with a javascript new window than the non-XHTML compliant 'target' variant. Even with a warning, people will ignore it, and then complain.

chrism2671’s picture

I tried creating a new window link using 'Rewrite this field' and tokens but at no avail. Is this patch now in the dev trunk?

dawehner’s picture

No its not.

Here are two different patches:
- one using target _blank: http://drupal.org/node/445166#comment-2015990
- one using js: http://drupal.org/node/445166#comment-2015812

merlinofchaos’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.