Jump to content
  • 0

Check Box With Link


techsavyy

Question

3 answers to this question

Recommended Posts

  • 0

I want to display terms and conditions in module for domain registration.

 

I have written code as following in config file.

Configure::set("domain_fields.nl",array(
    'Term' => array(
            'label' => Language::_("domain.Terms",true),
            'type' => "checkbox",
            'options' => array(
                'Yes' => Language::_("domain.RegistryTerms",true)
            )
        )
);

Currently if i write <a href="#">Terms & Conditions</a> in Language::_("domain.RegisteryTerms",true), it show as it is instead of showing it as link.

Link to comment
Share on other sites

  • 0

Content is escaped when displayed, so the label attribute in the config would not be the place to include HTML. Instead, you could create a new attribute to include your custom link and language, then update the module where that field is rendered to check for those attributes and generate the HTML manually. In this case, you wouldn't be able to use ModuleFields, unless you left the label as plain-text, and set javascript that updated the plain-text to a link when the page is displayed.

 

e.g.

Configure::set("domain_fields.nl",array(
    'Term' => array(
            'label' => Language::_("domain.Terms",true),
            'type' => "checkbox",
            'options' => array(
                'Yes' => Language::_("domain.RegistryTerms",true)
            ),
            'custom_label_link' => "http://domain.com/",
            'custom_label_name' => Language::_("domain.terms", true)
        )
);

Then look for 'custom_label_link'/'custom_label_name' in your module, and make adjustments accordingly. While not identical, the Namecheap module does something similar in order to include tooltips. You can take a look at that module for reference.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...