Moving CSS code to external file?

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
AsciiSector
Registered User
Posts: 46
Joined: Mon Mar 19, 2007 3:57 pm

Moving CSS code to external file?

Post by AsciiSector » Tue Jul 29, 2008 7:30 pm

Going through the source code of a board html file I find this:

"NOTE: These CSS definitions are stored within the main page body so that you can use the phpBB2
theme administration centre. When you have finalised your style you could cut the final CSS code
and place it in an external file, deleting this section to save bandwidth."

I've got a css file for my template, so I thought I could just remove the definitions from my header template file, but the pages don't show up correctly. What's the proper procedure for moving the definitions to an external file?

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51758
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Moving CSS code to external file?

Post by Brf » Tue Jul 29, 2008 7:43 pm

The subSilver overall_header.tpl looks like this:

Code: Select all

<!-- link rel="stylesheet" href="templates/subSilver/{T_HEAD_STYLESHEET}" type="text/css" -->
<style type="text/css">
<!--
/*
  The original subSilver Theme for phpBB version 2+
.....

/* General page style. The scroll bar colours only visible in IE5.5+ */
body { 
	background-color: {T_BODY_BGCOLOR};

.....

</style>
The idea is to rip out all the code between the style tags and put it into subSilver.css. Then you uncomment the stylesheet tag like this:

Code: Select all

<link rel="stylesheet" href="templates/subSilver/{T_HEAD_STYLESHEET}" type="text/css">
Then you remove the style tags and everything in between...

You would have to replace all of the template codes like {T_BODY_BGCOLOR} with whatever hardcoded value you wanted.

AsciiSector
Registered User
Posts: 46
Joined: Mon Mar 19, 2007 3:57 pm

Re: Moving CSS code to external file?

Post by AsciiSector » Tue Jul 29, 2008 7:45 pm

Ahh, thanks. I just forgot to uncomment the stylesheet tag. :oops:

Locked

Return to “2.0.x Support Forum”