It’s a common technique for EE developers to use a DRY global variable for the disable= Channel entries parameter, where the variable disables categories, member data and pagination. But what if you need to allow say pagination but not categories or pagination?

Here’s a quick tip for you: set up multiple global variables to cover all eventualities!

{pv_disable_all} - disable categories, member data, pagination and relationships
{pv_disable-c} - disable categories only
{pv_disable-m} - disable member data only
{pv_disable-p} - disable pagination only
{pv_disable_r} - disable relationship sonly
{pv_disable-c-m} - disable categories and member data
{pv_disable-c-p} - disable categories and pagination
{pv_disable-c-r} - disable categories and relationships
{pv_disable-m-p} - disable member data and pagination
{pv_disable-m-r} - disable member data and relationships
{pv_disable-p-r} - disable pagination and relationships
{pv_disable-c-m-p} - disable categories, member data and pagination (relationships only)
{pv_disable-c-m-r} - disable categories, member data and relationships (pagination only)
{pv_disable-m-p-r} - disable member data, pagination and relationships (categories only)
...there may be more variations!

Now when you’re writing Channel entry tags in your templates you have instant access to anything you want to disable or enable.

All notes