Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am trying to simple access a counter for each node that gets displayed in contemplate. Is there a simple way to do this?
I created a variable in template.php which I can access in node.tpl.php, but not in contemplate. For each node displayed, I need to iterate a counter variable and display it.
I have been trying to figure out how to get this to work in contemplate for an hour now with no luck. I HAVE to just be doing something stupid or missing something simple. Can someone help me?
Thanks,
Sunsu
Comments
Comment #1
jrglasgow CreditAttribution: jrglasgow commenteda simple way to do it would be by using the variable_get() and variable_set() functions.
here is an example:
Will this work for you?