At times you may wish to stop certain users being able to access downloadable resources from your site. For example, you may allow paying subscribers to download reports, but not free accounts.
You can manage this within Zephr using a two phased approach – a feature rule to remove/disable the Download buttons on the front end, and a request rule to navigate users away from the resource.
Hiding the Download Button
- Create an entitlement – for example, ‘Download’
- Add the entitlement to the relevant bundles – for any users who will be allowed to download content.
- Create a UI component – for example ‘download-disabled’. Within this UI component, add the relevant paywall you would like users to see instead of the download button – this could be a paywall, or may just be a block to hide the button.
- Create a Feature Rule – for example ‘Download’.
- Within the rule, add an Entitlement check for your Download Entitlement. If yes, choose No Transformation. If no, choose UI Component, and select your download-disabled UI component. The rule should look similar to this:
- Copy the Zephr Feature Tags from the ‘Site Integration Tip’ and wrap these around the relevant download buttons within your CMS.
Redirecting from Resources
After hiding the download button, you may also wish to remove access to the sections of your site where downloadable content is hosted. For this, you will use request rules.
- Add a new Request Rule – for example ‘Download Content’
- Under Conditions, check ‘URL Path Matches’
- Enter the URL path for Downloadable content – ideally a pattern, e.g. ‘/downloads/*’ or this could be for a specific path.
- Within your rule, add an Entitlement check for your Download Entitlement. If yes, choose Allow (under Responses). If no, set what you would like the desired outcome to be – for example, you may wish to use a Simple Redirect to send users to a page that displays a paywall.