category.request_access_url

Previous page  First page  Next page

category.request_access_url is a string variable containing an URL that if accessed will automatically send an email message to the blog's administrator requesting access to the current category.

 

This variable is typically used in cases where a reader goes to a category for which s/he has not been granted permission to view. If the default base template, if blog administrator checks the Allow readers to request access to private content checkbox located in the Options sidebar of the General page in the Settings section, blog.allow_access_requests is set to true, which causes an empty category page to be shown. The page contains the text "The category you are viewing is restricted. Click here to request viewing access". The phrase "Click here" will be linked to an URL that if accessed will automatically send the access request email to the blog's administrator, and the URL is the one contained by category.request_access_url. The reader clicks this link to send an email message to the blog administrator's email address. The message looks like this:

 

From: [Reader's first name] [Reader's last name]

Subject: Access request received from [Reader's username]

Date: [Date and time request was made]

To: [Administrator's name]

 

[Reader's first name] [Reader's last name] ([Reader's username])has requested access to view category [Category name] for blog [Blog name].

 

To enable access for [Reader's username] to this category, follow the link below:

 

[Link]

 

Following the link (in many mail clients, clicking the link will follow it) will grant the user access permission to view the category.

 

 

Example

 

The example below is a simplified version of the code from the default base template. If all these conditions are true:

 

The reader does not have permission to view the restricted category (that is, if category.restricted is true)
The reader is logged in (that is, authenticated is true)
The reader is allowed to ask for permission to view the restricted category (that is, if blog.allow_access_requests is true)

 

... then the reader will be shown an empty category page with the text "The category you are viewing is restricted. Click here to request viewing access". The phrase "Click here" will be linked to an URL that if accessed will automatically send the access request email to the blog's administrator. This URL is contained by the template variable category.request_access_url:

 

{{if category.restricted}}

The category you are viewing has restricted privileges.

 

{{if authenticated}}

 

{{if blog.allow_access_requests}}

The category you are viewing is restricted. <a href="{{category.request_access_url}}">Click here</a> to request viewing access.

{{/if}}

 

{{else}}

Please login or <a href="{{users_signup_url}}">signup</a> for a new the blog system account.

 

{{/if}}

 

{{/if}}