PDA

View Full Version : How use Common Template editor


sea_blue
07-02-2017, 06:39 PM
i want include a script and style in each page, for all styles.

After searching for the easy way, I found style manager > common templates (https://www.vbulletin.com/docs/html/stylemanager_common_templates). It looks exactly my need! but anything I write in the header ("123" or a script\style tags) causes the page to go wrong with the error in the browser console:

footer-rollup-531.js:352 Uncaught ReferenceError: pageData is not defined
at footer-rollup-531.js:352
at footer-rollup-531.js:352
at footer-rollup-531.js:352

footer-rollup-531.js:262 Uncaught TypeError: F.reverse is not a function
at Array.E (footer-rollup-531.js:262)
at Object.runCallbacks (footer-rollup-531.js:262)
at Object.init (footer-rollup-531.js:262)
at HTMLDocument.<anonymous> (footer-rollup-531.js:262)
at j (jquery.min.js:sourcemap:2)
at Object.fireWith [as resolveWith] (jquery.min.js:sourcemap:2)
at Function.ready (jquery.min.js:sourcemap:2)
at HTMLDocument.I (jquery.min.js:sourcemap:2)

In Omnibus
07-02-2017, 06:57 PM
Why would you edit that template?

What is it you are trying to add?

sea_blue
07-02-2017, 07:50 PM
i want add the https://highlightjs.org/ library.

I've already created a BBC tag, and all I have to do is add the script and style:

<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

noypiscripter
07-03-2017, 12:17 PM
Do you want to include those css and js files on every page or in a particular page only?

sea_blue
07-03-2017, 12:26 PM
every page.

Lynne
07-03-2017, 02:18 PM
Where in the header template did you add those lines? I added them to just above the </head> tag and I am getting no errors on my test site.

sea_blue
07-03-2017, 03:17 PM
a. I did not add them directly to the template, but I used this form: admincp > style manager > thems > go to "common template". https://www.vbulletin.com/docs/html/stylemanager_common_templates.
i add there in "header" field.
if the right way it edit directly the template, I would love to know what and how, for apply globaly all styles at onc.

b. not only if I write the code I brought brings an error.
But even if I just write "123". This is indeed written on the page, but the whole page goes wrong as if it lacks a critical closing tag.

Lynne
07-03-2017, 05:55 PM
Go to Styles > find your style > Edit Templates > find the "header" template and add the code there.

sea_blue
07-03-2017, 06:04 PM
Go to Styles > find your style > Edit Templates > find the "header" template and add the code there.

I asked if there was an easy way to do this for all styles in one place.

and also what does the form I mentioned? Not for that exactly?

noypiscripter
07-03-2017, 09:51 PM
Can you post a link to your forum?

sea_blue
07-04-2017, 01:30 AM
no. i cant.

Lynne
07-04-2017, 06:42 PM
I asked if there was an easy way to do this for all styles in one place.

and also what does the form I mentioned? Not for that exactly?
Typically, your 'top' style is the one where you edit templates, and the child forums is where you just change colors. So, editing the top style would be the only thing you need to do. If you don't have it set up this way, then you will need to edit every style.

sea_blue
07-05-2017, 08:29 AM
ok, thank.