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.
Options

Template Errors

XarcellXarcell North Carolina
edited July 2012 in Vanilla 2.0 - 2.8

How do I properly add javascript or PHP to the default.master.tpl? I'm struggling trying to figure this out.

Comments

  • Options
    KasperKasper Scholar of the Bits Copenhagen Vanilla Staff
    edited July 2012

    kasperisager said:
    ...and if you want to add JS directly in the .tpl master view, you'll need to use the {literal} tag like this:

     {literal}
        <script type="text/javascript">
            ...
        </script>
     {/literal}

    That covers the JS part of your question. I don't know about PHP though :)

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

  • Options
    422422 Developer MVP
  • Options
    peregrineperegrine MVP
    edited July 2012

    for php make your own function in smarty - see my signature and follow all the links.

    probably easier to make a plugin.

    what you really want to do is probably modify your views though.

    so you are going to need to download some themes and look in the views folders.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    XarcellXarcell North Carolina

    Thanks for the help, I see how to do it. Got it working...

  • Options

    @R_J said:

    It's so easy, let's do it here together :)

    @R_J instead of relying on moderators who may or may not change things. It would certainly be easier to find with a new title under Tutorials, for others to find.

    you could just duplicate and create a new tutorial in the tutorials category.

    you could also duplicate this and add it to tutorials.
    http://vanillaforums.org/discussion/26793/translation-candidate

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    hgtonighthgtonight ∞ · New Moderator

    @peregrine said:
    It would certainly be easier to find with a new title under Tutorials, for others to find.

    ...

    you could also duplicate this and add it to tutorials.
    http://vanillaforums.org/discussion/26793/translation-candidate

    Done

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options
    peregrineperegrine MVP
    edited June 2014

    thx.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    Yes, I should have created a new discussion by myself, but I was so eager to write that HowTo, that I have completely forgotten, that it would be at the wrong place...

Sign In or Register to comment.