[development] print token in theme layer

Ms. Nancy Wichmann nan_wich at bellsouth.net
Wed May 25 01:15:04 UTC 2011


http://drupal.org/project/submitted_by

 
Nancy
Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.




________________________________
From: Pooya <pooya.source at gmail.com>
To: development at drupal.org
Sent: Tue, May 24, 2011 9:09:14 PM
Subject: Re: [development] print token in theme layer


Thank u :) I want to have "node submit time" the exact way I want, so I checked 
out tokens available in devel(when viewing story node type) and found out there 
are already enough details I need in tokens(like small day, long day name,...). 
All I want is to <span> some of these tokens the way I want in template, I'm 
gonna check out this token_replace() to see what I can do with. maybe finish the 
job in preprocess and then use it in node-story.tpl.php 



Never done this before, not sure if it's even possible to use tokens passed to 
node.

If I'm missing sth or there's anything u can help me with share, It's a lot time 
saver at this point. Thanks for your time :)


On Wed, May 25, 2011 at 5:10 AM, Michael Favia <michael.favia at gmail.com> wrote:

On 05/24/11 18:08, Pooya wrote:
>> Is it possible to print tokens( I can see in Token tab of devel module
>> in a node) in theme? like simple echo or something?
>> I want to use it in node-story.tpl.php
>While you can probably call a token replacement function token_replace()
>they are usually reserved for plaintext user input in the UI. You have
>direct access to most variables required inside the template or
>preprocess function. If you elaborate a little further about your goal
>id be happy to help you do this ina more "drupalesque" fashion itll also
>give you more power in your regular theming.
>
>--
>Michael Favia                   michael at favish.com
>tel. 512.669.5650            http://www.favish.com
>
>


-- 

Pooya Sanooei

Twitter - Facebook - Website
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20110524/8a288d4c/attachment.html 


More information about the development mailing list