Skip to content
This repository was archived by the owner on Sep 20, 2021. It is now read-only.

Configuration Options

CodeMeister edited this page May 1, 2013 · 4 revisions

###Intro###

Below are the configuration options for CookieAlert. Each option has a description of its usage along with the default values.


###cookie_name###

This is the name for the cookie that the visitor will see if they examine their browser cookie cache. It should be a unique name that will not be likely to conflict with cookies set by other websites. It should ony contain alphanumeric chacters along with the dot, underline and dash characters.

A good rational is to include a part of your own domain such as "_KatanaCode.com_cookie_notice".

Default: '_we_use_cookies'


###cookie_type###

Once the visitor accepts the cookie alert (or it is displayed the required number of times) the cookie records that no more alerts should be displayed This option affects how long it will be until alerts are displaed again. The cookie can live for either, the duration of the session, a fixed number of days or permanently.

A session cookie means that once the visitor closes their browser the cookie will become invalid and the next time they visit your website the alert will be displayed again.

A fixed_duration cookie means that alerts will not displayed again for a specific number of days.

A permanent cookie means that alerts will never be displayed again

Options: 'session', 'fixed_duration', 'permanent'

Default: 'session'


###num_days_until_cookie_expires###

If you have chosen to use a fixed_duration cookie, this option set the number of days the cookie should live for and must be greater than 1

Default: 1


###user_must_accept_cookie_use###

There are two key ways to configure CookieAlert. One is to display a Primary Alert message for a specified number of views, then remove the alert completely. The other way is to continualy display an alert until the visitor actively click a link accepting the notice.

When set to true the alert will continualy display until the user clicks an acceptance link.

When false alerts will stop displaying afetr a specific nuber of views.

Options: true, false


###use_secondary_alert###

If CookieAlert has been configured to display an alert until the visitor clicks an acceptance link, this option will allow a Secondary Alert to be displayed after the Primary Alert has been displayed a specific number of times.

The intended use is for the Primary Alert to be a large eye-catching notice that adter a few displays reverts to a smaller, more subtle, notice when the Secondary Alert is displayed.

When set to true the Secondary Alert will be displayed after the Primary Alert has been displayed a specific number of times.

When set to 'false' only the Primary Alert will be displayed.

Options: true, false

Note: user_must_accept_cookie_use must be set to 'true' for this option to take effect

Default: true


###max_alert_display_count###

If CookieAlert is configured to display Secondary Alerts, then this option represents the number of times the Primary Alert should be displayed before reverting to the Secondary Alert.

If CookieAlert is configured to only display a specific number of times before the alerts are removerd, then this option represents the bumber of times the Primary Alert should be displayed before all alerts are removed.

Options: An integer, greater than 2, respresenting the number of displays

Defaut: 5


###cookie_value_text_separator###

*ADVANCED

The cookie stores both the display count and the current URL for the visitor. The URL is required to re-direct the visitor back to the current page if the accept link is not configured for Ajax. As a cookie can only hold a single string, both these values are combined into a sting with the cookie_value_text_separator as a separator.

Should you be accessing the cookie data from another action, and the default separator conflict with your code, this option will allow you to change the separation string used.

Default: "~~"


###primary_alert_template###

*ADVANCED

If you have an existing view template you would prefer to use for the Primay Alert, rather than editing the default template, then this option will let you specify the template to be called.

Note the template should be a partial

Default: 'cookie_alert/cookies/primary_alert'


###secondary_alert_template###

*ADVANCED

If you have an existing view template you would prefer to use for the Secondary Alert, rather than editing the default template, then this option will let you specify the template to be called.

Note the template should be a partial

Default: 'cookie_alert/cookies/secondary_alert'


###js_acceptance_template###

*ADVANCED

When the visitor clicks an acceptance link, and the link uses JavaScript to make an Ajax call, this is the JavaScript template that is rendered.

If you have an existing JavaScript template you would prefer to use, rather than editing the default template, then this option will let you specify the template to be called.

Dfault: 'cookie_alert/cookies/cookie_accepted'


Clone this wiki locally