Users running a non-download version of Vanilla (pulled from github), on branch release/2019.016 or master from the last 2 weeks should upgrade to release/2019.017 or latest master for security reasons. Downloaded official open sources releases are not affected.
Please upgrade here. These earlier versions are no longer being updated and have security issues.

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

  • 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

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

    UnderDog
  • XarcellXarcell North Carolina

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

  • @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.

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

    peregrine
  • 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.

  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

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


    peregrine
Sign In or Register to comment.