Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

[Documentation] Accessing the PHP equivalents of smarty theme tokens, i.e. {head}

edited March 2012 in Vanilla 2.0 - 2.8

Hello.

I am having trouble finding out how I can access dynamic values in my PHP template. In the smarty version I can use tokens like {head}, {BodyClass}, {BodyID}, {asset name="Content"}, etc. I would like to access these same values provided by Vanilla in my PHP template. If that's not possible, I'd be happy to learn how to create custom tokens and go back to smarty.

All I need are some documents :)

Thanks for your time in helping me with this obstacle.

  • Chris

Answers

  • ToddTodd Vanilla Staff

    Hope this helps:

    Smarty

    {asset name="xxx"}
    

    PHP

    $this->RenderAsset('xxx');
    

    Smarty

    {$BodyID}
    

    PHP

    $BodyIdentifier
    

    Smarty

    {$BodyClass}
    

    PHP

    $this->CssClass
    
  • That's perfect, thanks Todd.

  • @Todd, what about:

    {dashboard_link}
    {discussions_link}
    {activity_link}
    {inbox_link}
    {profile_link}
    {custom_menu}

    And any other Smarty(pants) tag that's been defined?

Sign In or Register to comment.