[development] print token in theme layer

Pooya pooya.source at gmail.com
Wed May 25 04:18:25 UTC 2011


thank u all for comments, this really helped. But I'm still curios how I can
really do this anyway? There's a lot of other tokens I can use exept date.

On Wed, May 25, 2011 at 5:46 AM, Lee Rowlands <contact at rowlandsgroup.com>wrote:

>  in your preprocess_node hook set the date time how you want it with
> $vars['mydate'] = format_date($vars['node']->updated, 'custom', 'd/m/Y');
> change the d/m/Y to suit
>
>
>
> On Wed, 2011-05-25 at 05:39 +0430, Pooya wrote:
>
> 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 <http://twitter.com/sourcesoft> - Facebook<http://facebook.com/pooya.sanooei>-
> Website <http://www.javabgoo.com>
>
>
>
>
>


-- 
Pooya Sanooei
Twitter <http://twitter.com/sourcesoft> -
Facebook<http://facebook.com/pooya.sanooei>-
Website <http://www.javabgoo.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20110525/c706a938/attachment-0001.html 


More information about the development mailing list