@Flowdeeps
send a reply
11 years, 5 months ago
@sf-micz
Snippet:
[
Context]
Letting Bots see content behind your paywall
Setting up your site to allow access to your subsrciber content is simple with browser detection. As we're only looking for two results, whether the viewer is a bot or a paying customer, we've wrapped both of the requests into a single if statement with the or operator "||". If the detection fails on either count this snippet drops the client to
{{ if $gimme->browser->ua_type == "bot" || $gimme->article->content_accessible }}
<h2>{{ $gimme->article->title}}</h2>
<div>{{ $gimme->article->full_text }}</div>
{{ else }}
<p>You are not authorised to view this article. Please consider paying for a subscription.</p>
{{ /if }}