Go Back   vb.org Archive > vBulletin 5 Connect Discussion > vB5 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-02-2017, 06:39 PM
sea_blue sea_blue is offline
 
Join Date: Jul 2017
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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)
Reply With Quote
  #2  
Old 07-02-2017, 06:57 PM
In Omnibus's Avatar
In Omnibus In Omnibus is offline
 
Join Date: Apr 2010
Location: Inside A Blade Server
Posts: 840
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why would you edit that template?

What is it you are trying to add?
Reply With Quote
  #3  
Old 07-02-2017, 07:50 PM
sea_blue sea_blue is offline
 
Join Date: Jul 2017
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
  #4  
Old 07-03-2017, 12:17 PM
noypiscripter's Avatar
noypiscripter noypiscripter is offline
 
Join Date: Jul 2013
Posts: 468
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Do you want to include those css and js files on every page or in a particular page only?
Reply With Quote
  #5  
Old 07-03-2017, 12:26 PM
sea_blue sea_blue is offline
 
Join Date: Jul 2017
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

every page.
Reply With Quote
  #6  
Old 07-03-2017, 02:18 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 07-03-2017, 03:17 PM
sea_blue sea_blue is offline
 
Join Date: Jul 2017
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 07-03-2017, 05:55 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Go to Styles > find your style > Edit Templates > find the "header" template and add the code there.
Reply With Quote
  #9  
Old 07-03-2017, 06:04 PM
sea_blue sea_blue is offline
 
Join Date: Jul 2017
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
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?
Reply With Quote
  #10  
Old 07-03-2017, 09:51 PM
noypiscripter's Avatar
noypiscripter noypiscripter is offline
 
Join Date: Jul 2013
Posts: 468
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you post a link to your forum?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:47 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05064 seconds
  • Memory Usage 2,256KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete