vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB5 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=262)
-   -   How use Common Template editor (https://vborg.vbsupport.ru/showthread.php?t=325317)

sea_blue 07-02-2017 06:39 PM

How use Common Template editor
 
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. 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:

Code:

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:

Code:

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

Quote:

Originally Posted by Lynne (Post 2588105)
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

Quote:

Originally Posted by sea_blue (Post 2588106)
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.


All times are GMT. The time now is 07:10 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01864 seconds
  • Memory Usage 1,738KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (13)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete