Kentico CMS 7.0 Developer's Guide

Available web parts

Available web parts

Previous topic Next topic Mail us feedback on this topic!  

Available web parts

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

To offer the user an option to choose the desired level of allowed cookies, you can use these two web parts. Technically, it is a single web part implemented in ~/CMSWebParts/General/CookieLaw.ascx and the "simple" one is just a preconfigured version of the same web part. These web parts are not visually designed, and you need to update your CSS style to get the desired look and feel.

 

You can find both of these web parts under the General -> Cookies category in the web part catalog.

 

Cookie law consent

 

This web part can be used to ask a user for a consent with using cookies. It offers three levels to choose from (as described in Cookie levels topic) - No cookies, Only essential cookies and All cookies. On each level, actions to switch to the remaining levels are offered. You may customize the text messages, available actions as well as button texts.

 

The option Compare current cookie level to is a basis for other settings in the web part. It defines a level to which the user's current cookie level is compared. Then, according to this setting, three states with their own settings are defined: One state is when the current level is below the compared level, the second when the level exactly matches it, and the third when the current level is above the compared level. This should give you enough options to configure the web part to suit your needs.

 

Note that changing the cookie level works only in the live site mode, as you do not need to clear your cookies in the design mode. For designing purposes, there is another property which simulates the user level in the Edit and Preview mode.

 

The default cookie level is currently not set in this web part so it keeps the level "All" as the starting level, but you may change this setting too.

 

Simple cookie law consent

 

This is a preconfigured version of the previous web part. It allows you to easily implement a simple cookie law consent. The preset behavior is: Disable cookies by default, request allowing, and once allowed, hide the web part.

 

 

InfoBox_Note

 

Live site

 

Once you place the web part into your website, you might not see it's message after switching to the Live site. The reason is that administrators have cookies enabled by default and the cookies are already stored on the computer you are working on. To check whether your configuration of the cookie web part is correct, log out of CMS Desk and clear all cookies in your browser. Or try the website in a different browser or computer.