Open term of use in new window for better usability to avoid re-input the register form again if its link is clicked.

< $checkbox_label = str_replace('@link', l(check_plain($node->title), 'node/'. $node->nid, array('attributes' => array('target' => '_blank'))), $checkbox_label);
---
> $checkbox_label = str_replace('@link', l(check_plain($node->title), 'node/'. $node->nid), $checkbox_label);

CommentFileSizeAuthor
#10 popups.patch1.18 KBshenzhuxi
#5 terms_of_use.patch929 bytesshenzhuxi

Comments

kars-t’s picture

Status: Needs review » Needs work

I think this might be a nice option.

Please add a switch to the settings form and make a real patch out of this.

http://drupal.org/patch/create

shenzhuxi’s picture

The register form shouldn't never be refresh when users look at the term of use.
So it's not necessary to keep it open in the some page.

kars-t’s picture

Hi shenzhuxi

yes and your patch adds target="_blank" to the link.

Please add this as option to the admin form and create a patch for this. :)

venusrising’s picture

I tested this code and it seems to work well.

shenzhuxi’s picture

Version: 6.x-1.10 » 6.x-1.12
Status: Needs work » Needs review
StatusFileSize
new929 bytes

The attach is the patch file for 1.12.

kwinters’s picture

The patch is a little messy (whitespace mostly).

Kars-T was asking you to also add a setting to the admin config form, but I don't think that's all that beneficial. Accidentally losing all your info in the register form carries a huge usability cost, so it really needs to open in a new window. If you want to add a setting for it then fine, but that's minor compared to the impact of changing the default.

So, I'd much rather the change was committed as-is rather than wait on a setting.

kars-t’s picture

@kwinters
Better use invalid HTML than loosing all data? Breaks my heart but I see your point. :)

I have some difficulties to deciede if its wise to change the behaviour as people are used to this. They don't like it but its expected to happen. I will talk in IRC about this a bit.

kwinters’s picture

I'd argue that most non-technical audiences are used to "new window" on pages with forms. See http://www.nytimes.com/gst/regi.html or http://commerce.wsj.com/entitlements/release_freereg_rel3/login.shtml?ro...

walden’s picture

+1 for committing the change as is - since this feature is placed at the bottom of the registration form, users definitely pay the price (by loosing all of their entered data) for viewing the t&c.

Loading the t&c in a modal window would be really slick if lightbox/thickbox modules are present.

shenzhuxi’s picture

Issue tags: +popups
StatusFileSize
new1.18 KB

The new patch add popups api support if the module is installed.

kars-t’s picture

Status: Needs review » Closed (won't fix)

Dear shenzhuxi

I really appreciate your patch and I feel bad fro not playing nice but I won't apply this patch. :-/

The problem is that we would need to add any POP JS through PHP than. Maybe a big switch. And pop up API even is not supported any more. Please comment on #807600: RFC: Terms of use 2.0 so we quicker can get to a 2.0 that is pluggable and we can add any JS popups as we like :)

kwinters’s picture

What about a simple _blank implementation for 1.x? It's trivial to make the change, so it's just a matter of agreeing that it's a good idea.

kars-t’s picture

IMHO "_blank" is evil but as you say would be a nice mini thing to fix. If you provide a patch as an optional setting I will happily add it. :)

lpalgarvio’s picture

provided there's a link to the terms, i don't think it makes sense to force open in a new window.

W3C HTML standards specifically advise against using target="_blank" and it doesn't even validate in the HTML/XHTML validators.

instead, they recommend you use the browser "open in new window". i think that is fair.

i would recommend you guys that a look on a few modules:
- Starbox API
- Colorbox (replaces Thickbox)
- Lightbox2
- Modalframe API
- Chaos Tools (might have something useful as an optional addon)

Thickbox and Popups API are deprecated.
I wouldn't recommend using Shadowbox module as it seems the developer is having problems with the creator of Shadowbox javascript library.

kwinters’s picture

Should this still be closed won't fix? That was added in response to a JS library addition.

I don't think that _blank should be required, but it (or something equivalent) is very frequently requested. A config option would be ideal, but a hook is also reasonable.

Recommending that visitors open something in a new window isn't something I can get behind in a form. Users don't read, and (as I've stated above), the losing-all-your-data penalty for a mistake is unreasonably high.

betoaveiga’s picture

Hi!

I found a very easy solution that could be good enough...

In your 'label for the checkbox' (see terms of use configuration) write something like:
I agree ... @link <a target='_blank' class='terms' href='/terms-of-use'>terms of use</a>.

In your CSS you put this...

#edit-terms-of-use-wrapper a {
  display:none;
}
#edit-terms-of-use-wrapper a.terms {
  display:inline;
}

Hope that helps!

lpalgarvio’s picture

hum so to sum up options...
#1) leave as normal link
#2) change link to target="_blank"
#3) add CSS to display TOS right after clicking the link
#4) show TOS in a modal window/overlay

for window/overlay module suggestion, i'll drop in another one:
- Starbox API - meant to replace colorbox, thickbox, lightbox, shadowbox and other *box modules (D7)
- Colorbox (replaces Thickbox)
- Lightbox2
- Modalframe API - has multiple submodules and contrib modules, used by noderelations
- Chaos Tools (might have something useful as an optional addon) - used by panels
- Dialog API - has a few submodules, used by skinr 2.x

the first 3 options could be easily added to the configuration page in the next releases.
support for a modal window/overlay module is more complex.

benovic’s picture

don't know if this is a bigger mess, but at least you do not have to hack the module. Plus i use the JS "onclick" to stay XHTML valid.

Workaround using HOOK_FORM_ALTER:

$form['terms_of_use']['terms_of_use']['#title'] = str_replace( 'a href' , 'a title="Link opens in new window" onclick="window.open(this.href,\'_blank\');return false;" href' , $form['terms_of_use']['terms_of_use']['#title'] );
picxelplay’s picture

This could all be avoided if the module would just allow html. It's just messy with @link. This would solve all the multiple terms and _blank issues.

kenorb’s picture

Issue summary: View changes
Parent issue: » #1483718: Open terms in new window