Active
Project:
Smarty theme engine
Version:
6.x-2.0
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
4 Jan 2008 at 14:53 UTC
Updated:
21 Jun 2010 at 16:23 UTC
I want to theme CCK content types individually using Smarty templates. In Drupal there are a lot of variables which start with '#'.
For example, with PHPTemplate you would access the value of a CCK field this way:
<?php $node->content['field_my_field]['#value']; ?>
How can you access this variable with Smarty? The following does not work :(
{$node->content.field_my_field.#value}
Seems like Smarty does not allow variables which start with (or contain???) '#'. Would it be possible, that the Smarty Engine for Drupal 6 could work around this somehow? Or is this something wich can only be addressed by the Smarty developers directly?
Comments
Comment #1
djnz commentedThis is difficult to achieve without modifying Smarty code, which I don't want to do as it would make maintenance difficult. I am looking at a workaround involving pre-filtering the templates, but do not have a time-to-fix yet.
Comment #2
nRick1967 commentedIt could be fixed modifying the following line (in my Smarty version 2.6.26 the line number is 118):
As mentioned by djnz it implies to modify the Smarty code and be carefull in order to update the Smarty engine.