How should I go about recoding my site?
My site uses lot of tables. If I change all that and create CSS templates to eliminate the tables, what is the best way to apply the css templates without having to recreate every page from scratch?
p.s. I'm learning all this stuff not really an expert but I manage.
Thanks.
a_gajic posted this at 12:24 — 28th November 2006.
They have: 71 posts
Joined: Aug 2001
You shouldn't have to create every single page from scratch. Are you familiar with SSI's or PHP? You can easily create a template for your website so you will only need to change the 'one' page.
The Coder posted this at 14:10 — 28th November 2006.
He has: 71 posts
Joined: Nov 2006
can u please elaborate on your point please, Mr. a_qajic......
a_gajic posted this at 03:10 — 29th November 2006.
They have: 71 posts
Joined: Aug 2001
I'm saying that if you have a large website, it would be easier to create your template files (eg header.inc and footer.inc) and keep your main content separate.
It saves having to copy and paste loads of code... using SSI for example:
header.inc
<html>
<head>
<title>My Page</title>
</head>
<body>
<layout stuff...>
footer.inc
</layout stuff...>
</body>
</html>
And then your main page would be
index.shtml (.shtml is used for files using SSI's)
<!--#include file="header.inc" -->
<p>My main text</p>
<!--#include file="footer.inc" -->
The same goes for PHP really just change the include lines to <? include("file.inc"); ?> and save with a .php extension.
Adam
Abhishek Reddy posted this at 03:41 — 29th November 2006.
He has: 3,348 posts
Joined: Jul 2001
Well that depends what your pages are like. If they all have a common design/structure, then it could be easy to rewrite. If they are unique or substantially inconsistent, you'll have a more difficult task.
Either way, if you want to convert your site to CSS and templates, you will have to rewrite the lot at least once. Just remember that you'll probably never have to do it again -- or if you do, it will be way easier next time.
Note that CSS and templates are different things. Cascading Style Sheets (CSS) are used to define the stylistic appearance of stuff in your page. Like colours, fonts, sizes, etc.
Simple templates, like a_gajic described, are used to abstract out common code. If you have a header that appears on every page, for instance, you could store it in a template portion.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.