phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

css templates and how they work


 
Search this topic... | Search Styles Development & Discussion... | Search Box
Register or Login to Post    Index » Styles Development & Discussion  Previous TopicPrint TopicNext Topic
Author Message
itHomepage
Board Member



Joined: 06 Mar 2009

Posts: 2



PostPosted: Fri Mar 06, 2009 4:10 am 
Post subject: css templates and how they work

I have been trying to get the css moved out of the 'overall header file for bandwidth and other reasons into a seperate .css file.

When I do this, values such as T_BODY_BGCOLOR are not replaced show the correct #123456 style numbers which they are when the css is embedded in the 'overall_hdr.tpl' style section.

Can someone explain to me how to make this work? I have tried running the .css as a .php file. I have changed the .htaccess file to include:

AddType x-mapp-php5 .php .php4 .html .htm .css
AddHandler application/x-httpd-php .css

I am at something of a loss.

If I should have posted elsewhere I apologise in advance, but I have browsed both the sytle forums here and on the official site and now here and can find nothing relevant.

Many thanks in adanve

Neal
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 628
Location: Spain


flag
PostPosted: Fri Mar 06, 2009 4:26 am 
Post subject: Re: css templates and how they work

Hi,

A very nice phpBB Template Design Guide explains it all.

Have a good read and if you still have questions after reading it ask them here.

Greetings. icon_wink.gif

_________________
phpBB2 will never die, I hope!
Back to top
itHomepage
Board Member



Joined: 06 Mar 2009

Posts: 2



PostPosted: Fri Mar 06, 2009 7:18 am 
Post subject: Re: css templates and how they work

Hi, and thanks for the prompt answer.

The link is a great answer and I have done the things it says to do, however, my css file does not appear to be being parsed and is therefor generating css which looks like this:

background-color: {T_BODY_BGCOLOR};
scrollbar-face-color: {T_TR_COLOR2};
scrollbar-highlight-color: {T_TD_COLOR2};
scrollbar-shadow-color: {T_TR_COLOR2};
scrollbar-3dlight-color: {T_TR_COLOR3};
scrollbar-arrow-color: {T_BODY_LINK};
scrollbar-track-color: {T_TR_COLOR1};
scrollbar-darkshadow-color: {T_TH_COLOR1};

rather than this:

background-color: #ffffff;
scrollbar-face-color: #DEE3E7;
scrollbar-highlight-color: #FFFFFF;
scrollbar-shadow-color: #DEE3E7;
scrollbar-3dlight-color: #D1D7DC;
scrollbar-arrow-color: #006699;
scrollbar-track-color: #EFEFEF;
scrollbar-darkshadow-color: #98AAB1;


I have used firefox to examine the css files on this site (phpbb2refugees.com) and compared them to mine and the result is as described above.
Back to top
Merri
Board Member



Joined: 02 Feb 2009

Posts: 63
Location: Kanta-Häme


flag
PostPosted: Fri Mar 06, 2009 8:21 am 
Post subject: Re: css templates and how they work

CSS files aren't part of the template engine in phpBB2, meaning, not processed by it. In the other hand you could say phpBB2 wasn't properly designed CSS in mind, it was used to some degree but the full potential wasn't used. All style isn't controlled by CSS but is instead included via deprecated HTML attributes that were almost the only way to style a page in the 90's. subSilver is a mix of HTML and CSS based styling. These days the best practice is to only style via CSS and let HTML just handle the content and the structure of the page.

Now into fixing your problem: if you want to get all the correct values for your base CSS file and you don't have them, restore the style tag with all the CSS information into the overall_header.tpl, then visit any page on your forum and open HTML source code. Then copy the resulting CSS into an external file, colors should be then what you want. Once you've done this you can drop the style tag, but you can (and should) only change colors etc. via the CSS file you've created. You can ignore the theme settings of phpBB2.

_________________
Comboa Twitter
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 628
Location: Spain


flag
PostPosted: Fri Mar 06, 2009 9:15 am 
Post subject: Re: css templates and how they work

Are you sure you have done all the things the Guide tells you to do?

What template are you using?

_________________
phpBB2 will never die, I hope!
Back to top
drathbun
Board Member



Joined: 24 Jul 2008

Posts: 729
Location: Texas


flag
PostPosted: Fri Mar 06, 2009 11:14 am 
Post subject: Re: css templates and how they work

So the bottom line is as has been stated: the css file will not get processed by the template engine. The point of making an external css file is that it becomes static. You tweak the css file instead of tweaking the style via the style options in the admin control panel.
_________________
phpBBDoctor Blog
Back to top
Ornette
Board Member



Joined: 16 Mar 2009

Posts: 37



PostPosted: Mon May 25, 2009 11:29 am 
Post subject: Re: css templates and how they work

Hmm it would be possible to create a CSS file that would grab all the template variables from the database.

You could create a php file css.php and put it in your root, and change the template file overall_header.tpl from:
Code:
<!-- link rel="stylesheet" href="templates/subSilver/{T_HEAD_STYLESHEET}" type="text/css" -->
<style type="text/css">
<!--
/*
    The original subSilver Theme for phpBB version 2+
    Created by subBlue design
    ....
*/
-->
</style>

to:
Code:

<link rel="stylesheet" href="css.php" type="text/css" />


you could grab those CSS stylings from the overall_header.tpl, change that to a php file, grab the code from includes/page_header.php and place in it, and then put lots of
    <?php echo $theme['body_bgcolor']; ?>
in the appropiate places (e.g. this instance, where you see: {T_BODY_BGCOLOR} )

Could be quite easily made into a MOD, i already done half of it, to hide all the in-template stylings by placing into a
    <!-- BEGIN ... -->
    <!-- END ... -->
switch block and activating the style sheet reference:
template/subSilver/subSilver.css

i may even do it all properly very shortly myself!
icon_biggrin.gif
Back to top
Display posts from previous:   
Register or Login to Post    Index » Styles Development & Discussion  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT - 4 Hours
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0461 seconds using 16 queries. (SQL 0.0089 Parse 0.0008 Other 0.0364)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo