Hello,
I'm trying to set a node to $node->is_protected = 1 based on another modules status being set to 1 as well. How would I go about setting $node->is_protected to 1 in node.tpl.php?
Thank you for you help thus far.
Lee
Hello,
I'm trying to set a node to $node->is_protected = 1 based on another modules status being set to 1 as well. How would I go about setting $node->is_protected to 1 in node.tpl.php?
Thank you for you help thus far.
Lee
Comments
Comment #1
mtolmacs commentedBasically you cannot do this now except if you want to litter your node.tpl.php with SQL.
I recommend to write a simple module and let that module set the required status for the module. To implement such a method you can find an example in the latest HEAD (and in the latest version of DRUPAL5 branch) with the function name protected_node_set_protected(...)
If you can wait a little bit you don't have to implement a new module for yourself because I will roll out a new release of the modules, but it takes time (usually 1-3 days) to the d.o to publish it on the module page.
Comment #2
Grimlock commentedAwesome! Thanks a ton tolmi, I can wait no problem.
So when the new version of Protected_node is released how will I go about using it?
Thanks for your time.
Comment #3
mtolmacs commentedYayy. It's out :) Read the API.txt for details. I hope it helps
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.