This is possibly an over-specific case, but attached is a patch that alters the @link you can provide to open the terms in a "new window" (or whatever your browser behaviour is for target="_blank").
It's as hard coded as the choice to make the Terms link navigate to the terms page, but in my case, with the Terms checkbox at the end of a lengthy registration form, users were incredibly frustrated when they lost the whole form by clicking the T&Cs link.
Would suggest ultimately this be extrapolated away to an admin setting..?
| Comment | File | Size | Author |
|---|---|---|---|
| #25 | 1483718-25.patch | 8.05 KB | kars-t |
| #23 | 1483718-23.patch | 9.34 KB | kars-t |
| #21 | terms_of_use-1483718-21.patch | 8.23 KB | kars-t |
| #20 | Screen Shot 2015-05-27 at 18.39.16.png | 38.39 KB | kenorb |
| #20 | Screen Shot 2015-05-27 at 18.38.19.png | 28.1 KB | kenorb |
Comments
Comment #1
zincdesign commentedAhhh exactly what I was looking for! I have the same situation with a long application form and did not want to frustrate the user with having to fill in the form again. Thanks srlawr
Comment #2
nikit commentedThe same place, but:
This will show Terms of Use in Shadowbox window, without refreshing current page.
Also I am create bug for wrapping this into theme, not patching code.
Comment #3
rooby commentedI think it would be best to make an admin UI option to select the target as well as have the label themeable as per #744800: Separate checkbox_label generation into theme function
Comment #4
benjf commentedHere's a simple patch which adds Colorbox integration. It would be great if a number of these were options on an admin screen. For instance, this patch has no dimensions in the url query, so the Colorbox opens in the full window (obviously, it will need changing for other use cases). This patch doesn't check for the existence of the Colorbox module first, but it shouldn't be harmful since it only adds a CSS class. To make it work, you'll need to visit the Colorbox configuration screen add check the option for 'Enable Colorbox load'.
Comment #5
benjf commentedoops, here's the same patch without the full urls...
Comment #6
rooby commentedThe issue with the patch in #5 is it forces colorbox.
If it is to be included it should be an option that someone can select in the admin screen.
Comment #7
kars-t commentedHi
maybe we can just add a configuration option to add a css class to the anchor?
The patch above is fixed to colorbox and that is not what we really desire.
Comment #8
kars-t commentedUnassigning the task.
Comment #9
traveller commentedI used the same method as #2, but giving the link the relationship 'external' and using jQuery to open it in a new window.
rel="external"is also xhtml valid, fwiw.$checkbox_label = str_replace('@link', l($node->title, 'node/' . $node->nid, array('attributes' => array('rel'=>'external'), 'absolute'=>TRUE)), $checkbox_label);The backend setting solution would be better, of course.
Comment #10
TelFiRE commentedI'm throwing my support behind #7. Allowing us to add a class to the link makes colorbox, new window, and countless other things easier without forcing anything or adding much weight to the module.
Comment #11
rooby commentedThe #7 suggestion is also surprisingly similar to the suggestion in #6 :)
Comment #12
TelFiRE commentedJust thought you meant to be enable/disable colorbox. There's a lot more functionality than just that enabling classes would allow. But yeah same idea, don't force anything but we need a way to extend, class does this nicely imo.
Comment #13
selfsimilar commentedHere's a simple patch based on #5, but adding admin controls as per #6 & #7.
Based on 7.x-1.2
Comment #14
astutonetThe patch in #13 is more complete, but does not work with Shadowbox. Shadowbox need the attribute "rel".
The patch in #2 opens the Shadowbox, but the node of terms aren't opened in the modal window (in the finish of loading, the modal window is closed and the page opens normally in the browser).
I think it would be interesting to insert in the patch at #13 options for the use of the attributes "css" or "rel", which would expand the use of other modal modules.
Comment #15
adammaloneI disagree with #14. It creates a reliance or an expectation that the Shadowbox module will be enabled. The idea of adding in the class should allow themes to bring up the text in another manner. In this instance I think a hook_form_alter() in a custom module might be the best for your unique usecase.
#13 is almost RTBC, however I have a couple of additions. If these are rolled in, then I'll happily RTBC it. If I make the additions I won't be able to do that.
It would be good to specify that the classes should be space delimited if using more than one. We also don't need () if using e.g.
Do we need the (default) here?
window shouldn't be capitalised
This could be made more descriptive. 'Target value to be added to the link e.g. target="_blank"'
For code readability, I think it might be better to assign these two variable_get() calls to variables and put them in the l() function.
Additionally, we should add variable_del() calls to terms_of_use.install for the new variables introduced in this patch.
Comment #16
rpayanmPlease review.
Comment #17
adammaloneNice work @rpayanm, thank you.
Comment #18
kenorb commentedAny progress on this?
Comment #19
kars-t commentedHi
can you backup this patch that it is okay? I can commit it to the git but currently not test it...
Comment #20
kenorb commentedTested and it works as seen in the attached screenshots.
Comment #21
kars-t commentedOkay there where some very minrot things code wise as missing "," at last array items. I made a new patch to try if the automated test will work. If yes I will commit the patch. :)
Comment #23
kars-t commentedNext try
Comment #24
kars-t commenteddev version...
Comment #25
kars-t commentedAnd again without color.
Comment #27
kars-t commentedWould be great if somebody fixes the test and adds a test if the selectbox for the link type works.
Comment #28
ivnishComment #29
ivnishNeeds to reroll the patch against the latest dev
Comment #30
ivnishClosed due to inactivity. If it is relevant, we will open it again