HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

What is the right way to create a new custom link in the header using smarty function?

I m building a new theme and i created the file default.master.tpl Now i want to add a new link in the head panel of my site. I tried to add this
<a href ="./folder/test">LINK</a> but when you are redirected to the link page and click again this link the url becomes
mysite/folder/folder/test and if i click it again it turns to mysite/folder/folder/folder/test etc

Is there any smarty function/way that i can get the site url ??? For example...

 <a href ="{home_url}/folder/test">LINK</a>

Comments

  • Options
    ShadowdareShadowdare r_j MVP
    edited May 2018

    If your forum at the root of your URL, then you can leave out the period to get an absolute path: <a href="/folder/test">LINK</a>

    Anyway, you can use the link function like this: <a href="{link path="/"}/folder/test">LINK</a>

    Edit: haven't tested this now, but you might be able to use {link path="/folder/test"} as the link. You'll have to try it out.

    Add Pages to Vanilla with the Basic Pages app

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    The custom link Smarty function can do more than that: <div class="Button">{link text='GO!' path='/plugin/action' class='Button'}</div>

Sign In or Register to comment.