Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 01-13-2015, 04:50 PM
user25148 user25148 is offline
 
Join Date: Feb 2014
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default general question about templates/custom pages and styling

So i have a custom page (template?) created and the tabs all link to it fine etc...

Now usually with a html/php page I could write the code and then link it to a css stylesheet. Now I obviously want my custom page to be the same theme as the rest of my forum and be able to change themes with the rest of the forum. To do this, should I write all the html code for the page by editing the template in the adminCP? If so, how would I go about adding CSS to the page while keeping my theme? The additional.css file is not inherited across all my themes, so if I added it in there I would have to go through each theme and add the css to that themes additional.css file. Is there another way to do this?
Reply With Quote
  #2  
Old 01-13-2015, 06:04 PM
bridge2heyday's Avatar
bridge2heyday bridge2heyday is offline
 
Join Date: Aug 2014
Location: Egypt
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think you need to read this https://vborg.vbsupport.ru/showthread.php?t=228112
Reply With Quote
Благодарность от:
user25148
  #3  
Old 01-13-2015, 09:03 PM
user25148 user25148 is offline
 
Join Date: Feb 2014
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by bridge2heyday View Post
I've read over that several times, and already have the page created. I need to know where to style it using CSS.
Reply With Quote
  #4  
Old 01-13-2015, 09:16 PM
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Posts: 1,987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

additional.css. And if not all of your styles implement it, then make them. That's the way to do it through vB.
Reply With Quote
  #5  
Old 01-13-2015, 09:29 PM
squidsk's Avatar
squidsk squidsk is offline
 
Join Date: Nov 2010
Posts: 969
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you'd followed the guide as laid out by lynne then it would automatically be styled according to the selected style of the user. Further additional.css style rules would be used on that page as the setup includes the code necessary to include that file.
Reply With Quote
  #6  
Old 01-13-2015, 10:45 PM
user25148 user25148 is offline
 
Join Date: Feb 2014
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cellarius View Post
additional.css. And if not all of your styles implement it, then make them. That's the way to do it through vB.
Quote:
Originally Posted by squidsk View Post
If you'd followed the guide as laid out by lynne then it would automatically be styled according to the selected style of the user. Further additional.css style rules would be used on that page as the setup includes the code necessary to include that file.
Thanks for the replies. I know additional.css would work but I wanted to know if there was a better way instead of going through each themes additional.css and add the same CSS code.
Reply With Quote
  #7  
Old 01-14-2015, 12:06 AM
squidsk's Avatar
squidsk squidsk is offline
 
Join Date: Nov 2010
Posts: 969
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by user25148 View Post
Thanks for the replies. I know additional.css would work but I wanted to know if there was a better way instead of going through each themes additional.css and add the same CSS code.
Yes create a template called mypage.css and link to it in the head section of your custom page. Naming the template with .css at the end will group it in with the other css templates in vbulletin.
Reply With Quote
Благодарность от:
user25148
  #8  
Old 01-14-2015, 05:08 AM
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Posts: 1,987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by user25148 View Post
Thanks for the replies. I know additional.css would work but I wanted to know if there was a better way instead of going through each themes additional.css and add the same CSS code.
You should have a parent style with your own styles as child style, so changes are inherited.
Reply With Quote
  #9  
Old 01-14-2015, 07:24 AM
user25148 user25148 is offline
 
Join Date: Feb 2014
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by squidsk View Post
Yes create a template called mypage.css and link to it in the head section of your custom page. Naming the template with .css at the end will group it in with the other css templates in vbulletin.
I went ahead and made a css file and it did group itself with the other css templates in the style manager. I tried to link my custom template page to this css file using
Code:
<link rel="stylesheet" type="text/css" href="name of css template here">
in between the <head></head> tags however this had no effect and the code inside this css template did not run.

Quote:
Originally Posted by cellarius View Post
You should have a parent style with your own styles as child style, so changes are inherited.
The styles do have a main parent style but alot of the code that creates the variations of the themes is probably in the additional.css file and therefore it isnt inherited.
Reply With Quote
  #10  
Old 01-14-2015, 07:56 AM
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Posts: 1,987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by user25148 View Post
I went ahead and made a css file and it did group itself with the other css templates in the style manager. I tried to link my custom template page to this css file using
Code:
<link rel="stylesheet" type="text/css" href="name of css template here">
in between the <head></head> tags however this had no effect and the code inside this css template did not run.
You don't create actual files in the template manager, and therefore you can't integrate them that way. That code would look for a stylesheet file with that name in your forum root, and where should that come frome?

You need to create an actual, physical css file in your file system and link to that properly.
Reply With Quote
Благодарность от:
user25148
Reply

Thread Tools
Display Modes

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 11:54 PM.


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.11285 seconds
  • Memory Usage 2,264KB
  • Queries Executed 11 (?)
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
  • (8)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
  • (3)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit
  • (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_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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete