How and where to add JS code?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Eden Genesis
    Member
    • Aug 2014
    • 42
    • 4.2.X

    [CMS] How and where to add JS code?

    Hello,

    I'm contacting you because I have an important question to ask about adding js code to my vBulletin forum.

    I have purchased a userback license and they are telling me that I need to add the code to every page where I want to display the userback support icon on my site.

    I would like the icon to appear on all threads and categories on my forum so that if I have a problem, the same can use the tool I bought, which will send me a detailed screenshot of the problem they have encountered.

    The widget code that offers me the site is in several formats: JS (Jacascript), npm; React or Vue.js.

    Having no idea how to use the latter 3, I thought I'd use the JS code they provide but the only information they give me is that I need to paste the widget code before the closing </body> tag on every page I want to collect comments.

    What do I need to do to get the widget to appear on all my forum pages and where do I put the javascript code?

    I have read that some advise to create a plugin in .xml but I have no idea how to create a plugin.
    Is it complicated? I guess it's more complicated than adding the code provided in a file I name .xml.... so I need your help and hope you can help me find a solution...

    Thank you in advance for your precious help!‚Äč
  • Trevor Hannant
    vBulletin Support
    • Aug 2002
    • 24196
    • 5.7.X

    #2
    I'd suggest if you're not sure on how to create this as a plugin that uses a template hook that you don't go down that line at all.

    When you say "categories", do you mean the categories that hold the sub-forums or the sub-forums themselves? If it's each individual subforum, edit the 'forumdisplay' template to add the code above the closing Body tag.

    For threads, edit the 'showthread' template.

    This will need to be done in all individual styles you allow customers to use.
    Vote for:

    - Admin Settable Paid Subscription Reminder Timeframe (vB6)
    - Add Admin ability to auto-subscribe users to specific channel(s) (vB6)

    Comment

    • Eden Genesis
      Member
      • Aug 2014
      • 42
      • 4.2.X

      #3
      Thank you for your reply.

      I'll try to do as you said and see if it works.

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...
      😀
      😂
      🥰
      😘
      🤢
      😎
      😞
      😡
      👍
      👎