Form.Checkbox.SubscribeToNewsletter

Version: - string  

Summary

Returns the form input field for the checkbox used for subscription to newsletters.

<input type="checkbox" name="NewsletterSubscriptionCheckBox" id="NewsletterSubscriptionCheckBox" /><label for="NewsletterSubscriptionCheckBox">Subscribe to newsletter</label>

Settings

The value is generated automatically.

The label for the checkbox is based on the 'Subscribe' checkbox label field in the Forms (for Data Lists) Paragraph settings:

(Page - Paragraph - Module - Newsletter - 'Subscribe' checkbox label)

Remarks

You specify what text input fields that are used for Name and E-mail in the form in the Form paragraph settings, and add the Form.Checkbox.SubscribeToNewsletter to the Forms default template.

Examples

Outputting the template tag

@GetString("Form.Checkbox.SubscribeToNewsletter")

Check if tag has a value

@if(!string.IsNullOrWhiteSpace(GetString("Form.Checkbox.SubscribeToNewsletter"))) { @* Tag has value, so let's do something useful here. *@ }

Assign tag to a value for later use

@{ string storedTag = GetString("Form.Checkbox.SubscribeToNewsletter"); }

Outputting the template tag

<!--@Form.Checkbox.SubscribeToNewsletter-->

Check if string has a value

<!--@If Defined(@Form.Checkbox.SubscribeToNewsletter)--> Let's output this tag here: <strong><!--@Form.Checkbox.SubscribeToNewsletter--></strong> <!--@EndIf(@Form.Checkbox.SubscribeToNewsletter)-->