An introduction to the Radioactivity module
Breadcrumb
- Home
- PronovixBlog
- An introduction to the Radioactivity module
The module was developed by Uusi Suomi with the main goal to replace the node counter. The operating principle of the module follows the mechanisms of radioactive materials. You might be familiar with the term: half-life. This is a fixed constant of natural radioactive isotopes that denotes the time required for the measured radioactivity to fall to half its value. For example, radium has a half-life period of 1620 years. In case of the Radioactivity module, you can use this mechanism to keep track of the ‘hotness’ of different types of content. You just have to enter a starting value for radiation and a half-life time.
The module is only dependent on the ctools module, but if you want to use all of its features, you need the Views and Rules modules as well. Standard installation via Drush: drush dl radioactivity
The first thing you can set is the salt checksum. If you want to protect the radioactivity field against scripts or bots, you need to set up the salt, a random string. Then the module can calculate a checksum for each AJAX call. The next thing to set up is flood protection. This means, you can prevent the use of the callback function to raise the radioactivity field value. The radioactivity value will be calculated more accurately, but keep in mind this setting requires more resources.
The most important fields in this section: Name: This is the profile name. You should choose a name that reflects the scope of the profile. For example, if you want to measure the views of articles and videos, you have to create separate profiles for each. Enable energy decay: By using this checkbox you can indicate if the Energy field value should automatically be reduced with time, or only by user interaction. Half life: Here you can specify (in seconds) how much time you want to have for halving the value of Radioactivity. The default value is 21600, which means six hours. For example, if you set here 3600, and the value of the field was 1000 in the beginning, after 3600 seconds (one hour later), the value of the field will be reduced to 500, and 250 an additional hour later. Energy cut off: This is the Energy level considered zero and not halved any more. Incident storage: Here you can set up how to store events. Three options are available:
When you are done with everything, save the profile. From this point on you are set up to start using the Radioactivity module.
Articles on devportals, DX and API docs, event recaps, webinars, and more. Sign up to be up to date with the latest trends and best practices.