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.

Paste in footer before the /head. Where would that be?

omnix32omnix32 New
edited November 2015 in Vanilla 2.0 - 2.8

There is no footer.php in the theme's folder, and I suspect something with bootstrap makes things different. I tried the code in
Admin.master.php
master.tpl
default.master.tpl so on in the Views folder.

The code is suppose to see bible scripture references such as Joh 3:6 or Dan 1:12 and on highlight with mouse pull up a box with the full scripture.

also looking to add Paypal button and might need to know the same information.

<script>
    var refTagger = {
        settings: {
            bibleVersion: "KJV",            
            roundCorners: true,
            socialSharing: ["twitter","facebook","google"],
            tooltipStyle: "dark",
            customStyle : {
                heading: {
                    backgroundColor : "#ea9999",
                    color : "#20124d"
                }
            }
        }
    };
    (function(d, t) {
        var g = d.createElement(t), s = d.getElementsByTagName(t)[0];
        g.src = "//api.reftagger.com/v2/RefTagger.js";
        s.parentNode.insertBefore(g, s);
    }(document, "script"));
</script>

I would be thankful for any ideas on this code and the future paypal code and it's placement location.

Mike.

Tagged:

Comments

  • hgtonighthgtonight ∞ · New Moderator

    If you have a custom theme, you can modify the default.master.tpl file to include your scripts where you would like them.

    You can also insert code right before the closing </head> tag by hooking in to the render asset event and checking the name:

    public function base_afterRenderAsset_handler($sender) {
      if($sender->EventArguments['AssetName'] != 'Head') return;
    
      // code here will be executed on every page after the head asset is rendered.
      echo 'sup from the head';
    }
    

    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.

  • peregrineperegrine MVP
    edited November 2015

    @ said: omnix32There is no footer.php in the theme's folder, and I suspect something with bootstrap makes things different. I tried the code in Admin.master.php

    personally I wouldn't mess with the admin.master.php, Period. Only you and admin roles will likely see it.

    • admin.master.php only refers to dashboard - no need to change

    • default.master.php is the place to change if you want to do a theme tpl change.

    • there is no footer template per se like wordpress.

    e.g.

    look in your theme you can insert script tap within literals where you want

           </footer>
    
            {event name="AfterBody"}
              Dan 1:12  - if you want a permanent one in template would probably appear in faint letters if in footer. or place it where you want.  change in css
              {literal}
                <script>
    
             add  your code here.
    
            </script>
            {/literal}
          </body>
    

    e.g. in post based on your code.

    you can also control what pages the js is executed on in a theme.

    see this for more examples.

    http://vanillaforums.org/discussion/31097/how-to-only-have-js-code-on-home-page-index-only

    then if someone posts the reference in a discussion the script would work.

    you could also probably use the message option from dashboard to add paypal button or use

    http://vanillaforums.org/addon/forumdonate-plugin and embed your button code - see instructions.

    you could also make a similar plugin to forum donate, that randomly select some of your reference (by putting a gob of references in an array and selecting one for display in a panel. If you don't know how to do it you could probably hire someone for that)and then a new reference could be selected on each page view.

    http://vanillaforums.org/discussion/28420/faq-what-frequently-asked-questions/p1


    As far as plugins there are numerous ways to add js as well.

    A plugin could allow changes on all themes.

    changing theme is theme specific, depends on your desires what you change.

    you have both methods now.

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

  • peregrineperegrine MVP
    edited November 2015

    I said default.master.php, I meant default.master.tpl regarding bootstrap.

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

  • @peregrine said:
    I said default.master.php, I meant default.master.tpl regarding bootstrap.

    once again, Peregrine comes to the rescue. It works!!! Not sure I care for the pink though, but that can be changed.

    Looking over forum and reading lots of stuff, it seems that if you ever leave or take a break, a whole lot of questions won't get answered.

    thank you very much.

    mike

  • peregrineperegrine MVP
    edited November 2015

    omnix32 said : thank you very much.

    you're welcome. Thanks for the kind words.

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

Sign In or Register to comment.