I have a series of pages (each one is the main page for a section of the site) that display a bunch of teasers, some of which are protected by premium, some are not. I would like to insert a small "premium content" icon before the title of each teaser that is protected. Is there any way I can tell which teasers lead to protected nodes and which don't? Maybe some variable that I can access?
I could hack the module but I'd rather keep it all in the template code if possible. A simple "str_replace" operation where I can replace a flag with the flag and an image tag would be ideal.
Many thanks,
D
BTW, premium is a great module, keep up the good work :-)
Comments
Comment #1
allie mickaThere is a flag called "premium" available on all nodes. The value of this flag will be 1 or 0. In your theme code, you could do something like:
Comment #2
dylanb commentedThanks for the speedy response. Just to clarify, in case anyone else is having the same problem, I followed your advice and amended the code in `node.tpl.php` in my theme folder (I'm using a theme based on bluemarine) so now it reads...
Comment #3
robobeau commentedHey, guys. This post helped to display an icon on the actual Node's page, and on Teaser/Node views, but can anyone help me do this on a Table view?
I already made an theme override function, it just doesn't detect $node->premium at all.
Is there any way I can detect wether a node is premium or not in Table View...? Changed the Version to reflect which module ver. I'm using.
Comment #4
robobeau commentedI did a little searching around the module and found the code I needed :)
I'm basically altering the class so I can do it all in CSS. Best of all, I can add the class to all the fields, so I alter any of the fields if it's premium. :)
Just put this in my zen template.php. If anyone knows a better way to do this, then by all means correct me!