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.

Additional smarty variable in default.master.tpl, how to add one?

I need to make an additional smarty variable {$real_url} available in default.master.tpl on my embedded vanilla forum.
$real_url = urldecode($_SERVER['QUERY_STRING']);
Which view/module/controller do I need to override in my theme directory to achieve this?

Alternatively, changing the tpl from default.master.tpl to custom.master.tpl depending on the url would equally work for me.

Thanks for any advice you can give me on this.

Tagged:

Best Answer

Answers

  • Excellent, Thanks!

    I am integrating Vanilla with Jamroom, and wanted to find a way of displaying the forum differently on specific Jamroom profiles. The intention is to remove the sidebar, menu, tabs, etc if the embedded forum is being viewed on a Jamroom profile (showing a specific category) rather than the main site forum.

  • you also have $Path which that processed by vanilla.

    grep is your friend.

  • KasperKasper Scholar of the Bits Copenhagen Vanilla Staff
    edited January 2013

    Just for future reference, additional Smarty vars can be added like this:

    public function Base_Render_Before($Sender) {
        $Sender->SetData('variable', whatever);
    }
    

    P.S.: This var is simply awesome http://www.smarty.net/docs/en/language.function.debug.tpl

    Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    maybe someone could help me get a grip on this...
    I have been reading on that smarty very cool stuff, I wanted to add a link to the mobile tpl but I must be doing wrong, I think the tpl is rich text because it fails to work when converted to plain text then tpl ... I just want to add {categories_link}

  • $Path only gives me the query string after # rather than the full url.

    {$smarty.server.QUERY_STRING} or {$smarty.get.remote} work in some situations, but not when viewing an individual discussion, so I guess I'm still looking for a way to determine if the embed is at mysite.com/forum or mysite.com/myprofile/forum

Sign In or Register to comment.