This is similar to the following post for D5:
http://drupal.org/node/332567
Except my patch (attached) makes this an option. It creates an additional variable (I also clean this up in hook_uninstall) that allows users who have selected the Page Link display option in admin to optionally check a box to make this link open in a new window. It was either this, or move the link to a template file using a hook_theme implementation. I figured the admin option was better for most users.
Please review. This is probably a better candidate for back-port to D5 than the other patch, which *imposes* the new window behaviour on all comers... Thanks! =)
Ps - I had to add form weights for admin, as the checkbox was appearing in an odd place.
Comment | File | Size | Author |
---|---|---|---|
#33 | Lightbox2_integration_and_new_window_field-372721-33.patch | 6.27 KB | abarpetia |
#14 | legal-target-blank-372721.patch | 4.03 KB | AaronBauman |
legal-page-link-new-page.patch | 3.6 KB | greg.harvey | |
Comments
Comment #1
vmenelas CreditAttribution: vmenelas commentedHow do you add this to your legal module?
Comment #2
greg.harveyYou read this section of Drupal.org and follow the instructions: http://drupal.org/node/60108
;-)
Comment #3
vmenelas CreditAttribution: vmenelas commentedI am still a little bit confused...do I save the file, if so what do I save it as?
Thank you
Comment #4
RG CreditAttribution: RG commentedHello,
Valery, if you want to patch your module, you have to save the patch in the good directory (here, the "Legal" module directory).
Then you navigate through the "cd" command to the good directory (i.e. "cd www/mywebsite/sites/all/modules/legal"), and you apply the patch.
To do this you have to type : "patch [-b] < your_patch_file.patch".
(the "-b" option creates a copy of your file before modifying it, can be useful).
Comment #5
Eugene Dubois CreditAttribution: Eugene Dubois commentedIs there a way create a pop-up window with only the terms and conditions?
Menu's etc. should not be there...
Comment #6
greg.harveyActually, thinking about it, an AJAX option would be nice! =)
Comment #7
foodbo CreditAttribution: foodbo commentedis it possible to integrate the "popup api" module with the legal module?? instead a new window but just "overlay".
I am quite new this drupal thing, and trying to read the readme.txt from popup api module, and seems shouldn't be hard to integrate them both ?? for the experience users, but just no clue what it is saying there.
would be appreciated if u can point me to the right direction.
Comment #8
Robert Castelo CreditAttribution: Robert Castelo commentedfoodbo good idea!
I've been wanting to add a Lightbox style effect rather than link to another page, and this looks like an easy way to do it.
I don't have time to do it at the moment, but it's high on my To Do list.
Comment #9
philipjohn CreditAttribution: philipjohn commentedWhat is the status of this? Did it get incorporated as I'm looking for a feature like this.
Roberto, I would be interested to know if you had a look at the lightbox-style effect - this would be ideal, rather than using a new window.
Phil
Comment #10
greg.harveyNo, it didn't. That's why it is still set to 'needs review'. I guess Robert is too busy to maintain the module right now. =(
Edit: It still applies though, there have been no commits for two years, so you can just apply this patch. And you can mark the issue 'reviewed and tested' if it works for you.
Comment #11
Robert Castelo CreditAttribution: Robert Castelo commentedI'll look into this next week. Will be doing a clean out of all issues of Legal module.
Comment #12
greg.harveyAwesome, thanks! =)
Comment #13
devkinetic CreditAttribution: devkinetic commentedI wrote a quick form alter so I didn't have to patch the module to hold my client over until this is rolled into CVS.
Toss this in a custom module:
You could also use this to add an overlay, since you can modify the a tag and add say a rel="[lighbox]" or something like that.
Comment #14
AaronBaumanoriginal patch no longer applies cleanly.
Here's an updated patch against 8.x dev.
Additionally, this adds an option for the admin to choose whether to use target="_blank" or XHTML-compliant rel="external"
Comment #15
Anonymous (not verified) CreditAttribution: Anonymous commentedThe code at #14 works fine.
However, there was a bug I had to fix before going public with it. The link to Terms & Conditions isn't localized. Changing l('Terms & Conditions'...) to l(t('Terms & Conditions')...) at legal.module fixes this. Maybe someone wants to update the patch, as I'm still not able to do, due to lack of intellect.
How comes this important thing didn't make it into the dev release for three years now? It is very inconvenient for new users, directing them away from the registration page after they probably filled in tons of fields, uploaded pictures and stuff for their profiles. Legal is hardly production quality without this patch.
Comment #16
greg.harveyGood catch on the t() function. Feature requests do tend to slip the attention of busy maintainers - bug reports take precedence. Frankly, this is unlikely to make it in to the D6 version now. Bumping forward a version, to see if there are any takers for a D7 patch.
Comment #17
marcoka CreditAttribution: marcoka commentedctools modal would be a way too.
Comment #18
marty.true CreditAttribution: marty.true commentedI guess the modal/lightbox concept got thrown out? It was mentioned back in Sept of 2010 that this was a good idea but still in v7, it is still not present? Almost all other sites that you see a "Terms of Service" link, it opens in an overlay so that you don't get taken away from the registration page... why has this not been accomplished yet?
I was able to make a simple change to the legal.module file, to include a lightbox call but it loads the entire page (with menus, etc) and not just the TOS text...
Comment #19
marcoka CreditAttribution: marcoka commentedlegal module has a lof of more important code issues than adding new features :)
Comment #20
Anonymous (not verified) CreditAttribution: Anonymous commentedBringing #14 to the dev version should be the least. Overlays are web 2.0 toys, but legal issues are a bit more serious. The terms should be very accessible, printable and their history absolutely transparent. Otherwise this module wouldn't reflect the need of serious webmasters for legal certainty.
Since this issue is brought up again, I wonder if the Legal module really is maintained. Doesn't seem so! Last commit to the dev is half a year old. Or do I miss something?
Comment #21
lindsayo CreditAttribution: lindsayo commentedInspired by #13, I wrote a quick little module to open the Terms & Conditions link in a new window:
This isn't checking the contents of the title string, instead it's checking for the part of the conditions array as set in the 3rd case in the legal preview function in legal.admin.inc. It's also using the correct form ID. :)
Comment #22
xarchmaemo CreditAttribution: xarchmaemo commentedXstatic, could you tell me what lines you edited in the legal module to make colorbox show up? The full page is livable for now for me.
Comment #23
warmth CreditAttribution: warmth commentedAny news about this?
#21 doesn't work for me.
Comment #24
warmth CreditAttribution: warmth commentedTemporally solved this using jQuery:
Note: second line is about #804592: T&C for contact form - Comment #4
Comment #25
spyderpie CreditAttribution: spyderpie commentedI vote for this feature!
warmth - where did you put this?
Thanks in advance,
Julie
Comment #26
warmth CreditAttribution: warmth commented@spyderpie, within one of my js files loaded with my custom theme.
Comment #27
Andre-Bfixed Drupal 7 Version of #21:
make sure to update the translation for that string, since it differs from legal module's one.
Comment #28
lindagreen CreditAttribution: lindagreen commentedWhat's the status of getting a fix into the Legal module?
Comment #29
cmonnow CreditAttribution: cmonnow commentedSince the user registration form itself is modified via hook_form_user_register_form_alter() you may have to use hook_module_implements_alter() or change module weights to make sure your code comes later if checking for an existing field.
In my case I sucked it up and added target="_blank" directly to the link in theme_legal_accept_label(). If a configuration option was ever decided on when Drupal 14 comes out in 2025 I would make opening a new window opt-out rather than opt-in to be consistent with current trends (you can even add rel="nofollow" while you're there for SEO purposes).
Comment #30
arnaldoaa CreditAttribution: arnaldoaa commentedHi, I add in template.php into /themes,
a small change in code #21 and it's worked for me.
Comment #31
abarpetia CreditAttribution: abarpetia as a volunteer commentedHello,
#21 thanks for quick fix. I managed to configure Lightbox2 module by using following code.
This weekend I'll try to Integrate Lightbox2 module with Legal module.
Comment #32
abarpetia CreditAttribution: abarpetia as a volunteer commentedPatch to integrate Lightbox2 module and optional field to open page link into new window.
Please take a look.
Comment #33
abarpetia CreditAttribution: abarpetia as a volunteer commentedForgot to delete variables. Here is the new patch. Thanks
Comment #36
Robert Castelo CreditAttribution: Robert Castelo as a volunteer and at Code Positive Services commentedThanks to everyone who worked on this patch!
I've added it to the 7.x-1.x-dev branch with some changes:
* Made the link target checkboxes into one radio field that is displayed dynamically if Link is selected as the Display Style
* Simplified and generalized the code so other modal dialog modules can be easily added
* Moved the Display settings below the T&Cs text field for a neater form
Comment #37
Robert Castelo CreditAttribution: Robert Castelo as a volunteer and at Code Positive Services commentedBytheway, the out of the box styling of T&Cs in the Lightbox2 modal is horrible.
If anyone wants to provide a patch with some styling it would be very welcome!