I have installed the module Legal and choose to have a checkbox on registration. On registration of a new user is then displayed:

  • Accept Terms & Conditions of Use *

The Terms & Conditions are link to page /legal in the same window.

I want to show this link in colorbox node so a style should be appended. Probably I have to modify the code (which I do not prefer) or can implement a hook for this? If so, how?

Any other suggestion?


You will have to add the class colorbox to the Terms and Conditions link generated by the Legal module.

This is easily setup through a theme_ function override.
Use the following code in your theme's template.php file:

    function YOUR_THEME_legal_accept_label($variables) {
      if ($variables['link']) {
        return t('<strong>Accept</strong> <a class="colorbox" href="@terms">Terms & Conditions</a> of Use', array('@terms' => url('legal')));
      else {
        return t('<strong>Accept</strong> Terms & Conditions of Use');

Note: you might have to tweak the output in the popup, but that's outside of the scope I guess.


Adding something like class="colorbox" is a variation of adding target="_blank".

So as an alternative to modifying your theme's template.php file (as in the previous answer), you may want to use some of the suggestions in issue #372721 on D.O. I.e.:

  • via a form alter, similar to what is explained in comment #27.
  • using jQuery, similar to what is explained in comment #24.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.