View Full Version : css class problems on vb4 custom page
nirvana43
12-18-2009, 09:53 AM
I'm trying to use predefined css classes from vbulletin on my custom page.
However its not showing me expected output (data in predefined class).
It just displays simple text output with no style.
My template under main style contains following code :
{vb:stylevar htmldoctype}
<html xmlns="http://www.w3.org/1999/xhtml" dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html">
<head>
<title>{vb:raw vboptions.bbtitle}</title>
{vb:raw headinclude}
</head>
<body>
{vb:raw header}
{vb:raw navbar}
<div id="pagetitle">
<h1>{vb:raw pagetitle}</h1>
</div>
<h2 class="blockhead">MY TEST PAGE</h2>
<div class="blockbody">
<div class="blockrow">
<table class="tborder" align="center">
<tr><td>My Test Data</td></tr></table>
<p class="forumdescription">My Test Description</p>
</div>
</div>
{vb:raw footer}
</body>
</html>
Above template gives me following output with no styles :
My Test Data
My Test Description
Lynne
12-18-2009, 02:06 PM
Are you doing anything to include the correct css templates in your page? Which css templates are you wanting to include?
nirvana43
12-19-2009, 12:25 AM
Are you doing anything to include the correct css templates in your page? Which css templates are you wanting to include?
I haven't created any css of my own.. i'm willing to include vbulletin's default style css...
Another thing is, whenever i switch to different style, it should automatically include that style's default css template..
I mean just like vbulletin 3.8 and below versions used to do. :)
for e.g. I'm willing to use "tborder", "tcat" etc. css classes which always comes with default css of any style.
Lynne
12-19-2009, 01:20 AM
What I'm saying is that you are using classes like blockhead and blockbody, which is fine, except it isn't going to do any styling unless you define those classes. You can find where vbulletin defines them and include the stylesheet in your mod, or you can define them yourself in the head of your template.
nirvana43
12-19-2009, 02:06 AM
Thanks for your reply Lynne,
I can't find where vbulletin defines blockhead and blockbody classes also... i mean in which css template..
And i'm trying to catch "tborder", "tcat" css classes from vbulletin's main CSS (The one we reach from AdminCp->Styles & Templates->Style Manager->Main CSS) but i cant find which css i'm suppose to include.. (or do i even have to include one manually for those classes)
Main CSS contains all the classes i'm willing to use in my custom template.
Lynne
12-19-2009, 02:48 AM
Do a Search in Templates for "blockhead" or "blockbody" and you should find them (probably in vbulletin.css). As for tborder and tcat, those are from vb3. They are not in vB4.
You say Main CSS contains all the classes you are willing to use, however, none of the class in Main CSS are in vB4. You are going to have to create your own css is my guess.
nirvana43
12-19-2009, 03:55 AM
I just found "blockbody" and "blockhead". They are :
<link rel="stylesheet" type="text/css" href="css.php?styleid=1&langid=1&d=1261137425&td=ltr&she et=vbulletin.css,popupmenu.css,vbulletin-chrome.css,components.css,vbulletin-formcontrols.css" />
Please check attached image. class "tborder" and "tcat" does exists in Main CSS.
May i please know how do i use those classes? or at least syntax to include that css. :)
Lynne
12-19-2009, 03:52 PM
Sure, it was in vB3, but it isn't in vB4. It says right at the top of that page:
Obsolute - This CSS file is obsolete and is available here for reference purposes only.
nirvana43
12-20-2009, 11:37 AM
Thank you Lynne for your time.
Finally i had to design my own css template for this issue.
Thank you again.
P.S. By any chance if you know any such inbuilt table classes (like tborder, thead, tcat etc.) then it will be very huge favor. :p
Lynne
12-20-2009, 04:59 PM
You can grab all the old stuff from an old .css file, like this from a default css file on my 3.8 site:
.tborder
{
background: #D1D1E1;
color: #000000;
border: 1px solid #0B198C;
}
.tcat
{
background: #869BBF url(../../images/gradients/gradient_tcat.gif) repeat-x top left;
color: #FFFFFF;
font: bold 10pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
}
.tcat a:link, .tcat_alink
{
color: #ffffff;
text-decoration: none;
}
.tcat a:visited, .tcat_avisited
{
color: #ffffff;
text-decoration: none;
}
.tcat a:hover, .tcat a:active, .tcat_ahover
{
color: #FFFF66;
text-decoration: underline;
}
etc
nirvana43
12-21-2009, 01:34 AM
Thanks a million Lynne...
Thats a huge favor. :)
farhad.khan
05-24-2010, 02:33 AM
Hi,
I am trying to do the same - to reuse predefined vbulletin css blocks like blockbody, blockrow, posthead in my custom pages.
I have not included any CSS in my page yet. Are there template vars I could use to include these? I am using {vb:raw headinclude} {vb:raw headinclude_bottom} and these have generated some css.
Thanks.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.