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

Reply
 
Thread Tools Display Modes
  #1  
Old 12-31-2009, 08:13 PM
angedelamort angedelamort is offline
 
Join Date: Nov 2009
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to add CSS tag properly in vb4

Hello,

I'm testing some functionality and since I'm not to used with the news "style" system I was wondering what is the right way to add custom CSS style:

Code:
<style>
.styleName div { border:ridge; }
</style>
so when I use it somewhere else, I can do

Code:
<div class="styleName">...</div>
Thanks
Reply With Quote
  #2  
Old 12-31-2009, 10:59 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can add it to a css template you create and add yourself to the page or to an existing css template or to the <head> of the page. There are many ways to do it, it's kind of up to your situation and what is best for you.
Reply With Quote
  #3  
Old 01-01-2010, 12:15 AM
consolegaming consolegaming is offline
 
Join Date: Jan 2007
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The approach I took personally was to create a custom template called style.css or whatever and then I added that to the list of css files that the headinclude template calls (there's a line with about 10 different css files being listed and I just added my custom one to the end of that).

Means that all my additions are in a separate template and means the difference between the original template and my own will be minimal making the upgrade process easier. In the past I used to spend ages comparing template versions to put that the changes I had made into the latest versions of the templates. So doing things this way means that will happen less often.
Reply With Quote
  #4  
Old 01-01-2010, 12:28 AM
angedelamort angedelamort is offline
 
Join Date: Nov 2009
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks. That's what I approximately did. consolegaming, I had the same problem as you with the merge with 3.x, so I'll do it your way since it's a really good idea for future updates.

But I was wondering if there was a system in place since it's common that you want to add your own styles and not really change the original one. It seems that you have to do it manually.
Reply With Quote
  #5  
Old 01-01-2010, 02:06 AM
consolegaming consolegaming is offline
 
Join Date: Jan 2007
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah they removed the Additional CSS function (which served this purpose on 3.x) for this version of VB which was a bit of a shame but this way works pretty well. Certainly not as user friendly though. Hopefully they'll try and rectify that in the future.

The other thing that should help updating templates is this template merger (or whatever it's called) thing they've introduced which to my understanding will compare your customized version of a template with the original/new versions and it'll try and merge the templates together.

So that should help things substantially though as I said in my previous post I'm still trying to keep the template modifications down to a minimum. i.e. the style thing from above as well as using custom templates for my header and footer (ad locations weren't suitable). Whereas previously my header code was in the 'header' template so having a 1 liner calling my custom template is a much neater solution lol.
Reply With Quote
  #6  
Old 01-23-2010, 12:34 PM
ageurtse ageurtse is offline
 
Join Date: Apr 2009
Location: almelo
Posts: 275
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi there i have a aditonal css template but i don't know how to include it to the list so it will be loaded.

how did you do that.
Reply With Quote
  #7  
Old 01-23-2010, 02:49 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The template additional.css gets loaded on everypage (except the ones that use the USERCP_SHELL since he forgot to add it there, but you can add it yourself).
Reply With Quote
  #8  
Old 01-23-2010, 02:55 PM
ageurtse ageurtse is offline
 
Join Date: Apr 2009
Location: almelo
Posts: 275
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i have almost managed it, except one tiny thing see new thread in programming help.
Reply With Quote
  #9  
Old 01-23-2010, 05:56 PM
BSMedia BSMedia is offline
 
Join Date: Feb 2009
Posts: 454
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by angedelamort View Post
Hello,

I'm testing some functionality and since I'm not to used with the news "style" system I was wondering what is the right way to add custom CSS style:

Code:
<style>
.styleName div { border:ridge; }
</style>
so when I use it somewhere else, I can do

Code:
<div class="styleName">...</div>
Thanks
it would be .stylename {border: ridge;}

<div class="stylename"></div>

if you define it your way, than all dives inside of styleName will also inheirt the border. But if thats what you want it won't be a problem
Reply With Quote
  #10  
Old 11-08-2010, 08:39 PM
gibigbig gibigbig is offline
 
Join Date: Jul 2007
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

in vb 4.0 you get a blank error when you edit the headerinclude template, why is this?
Reply With Quote
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 07:40 PM.


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.04366 seconds
  • Memory Usage 2,241KB
  • 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
  • (4)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