access variables that start with '#'

yojoe - January 4, 2008 - 14:53
Project:Smarty theme engine
Version:6.x-2.0
Component:Code
Category:support request
Priority:normal
Assigned:djnz
Status:active
Description

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?

#1

djnz - June 17, 2008 - 00:22
Assigned to:Anonymous» djnz

This 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.

 
 

Drupal is a registered trademark of Dries Buytaert.