I am trying to figure out how the $premium and $premium_access variables in the $node object work.
Here's what I am trying to accomplish:
1. Protect latest content for three weeks.
2. I am using CCK nodes, themed using Contemplate, so I see the $premium and $premium_access variables pop up. Contemplate lets me theme the teaser and body of the nodes.
3. On listings (ex. taxonomy/term/XX), I want a small icon to appear indicating that the item is protected, premium content.
With that in mind, how do I protect the CCK content, so that only the teaser is revealed during the premium period? Do I have to use a combination of $premium and $premium access to regulate access from within Contemplate? Or should it just show the teaser automatically?
From looking at the code, it looks like $premium is either 0 or 1, and indicates if the item has been restricted, and $premium access is either TRUE or FALSE, and set depending on conditional access ruless inside the module. Does $premium stay set at one even after the premium period has passed?
I would appreciate any help or insight into how people have used CCK with premium.
Comments
Comment #1
dgorton commentedHere's one way to make them work:
Comment #2
dgorton commentedUPDATE -- I should have made clear that the above code snippet will work within contemplate:
Home » administer » content » templates (as of 4.7)
Comment #3
allie micka