PDA

View Full Version : many similar pages, css or template ?



sebus
January 19th, 2006, 07:54 AM
i am building a site with many categories and the navigation/main section will stay the same but I don't want to edit each and every page when I add a new button to the section. Do you recommend CSS or should I just create a template in dreamweaver 2004 ?

abreev8
January 19th, 2006, 12:00 PM
You'll certainly want to use CSS, but that wont help you with the navigation because they still need HTML on each page.

Do you have php on your server/can you install it?

sebus
January 19th, 2006, 12:45 PM
yes i have php why ? i'm not that good at php or any programming for that matter

λ
January 19th, 2006, 01:05 PM
well.. to include another file in a PHP file, you can just do this:


<?php include ("nav.php"); ?>

That would include the file nav.php in the file, and whenever nav.php was changed the content would change as well :)

You could also use SSI (server side includes), but PHP is perfect for that kind of task.

senocular
January 19th, 2006, 01:12 PM
I'd do it in a DW template with CSS (no php). I wouldnt use PHP because, A) you dont know it that well. Though I would suggest learning it, I dont know if this is the best place to (include alone might not cut it depeding on file placement and references). And B) because in a template, you arent going to be able to visually see your php when editing in design view which isnt going to help you any when developing page content (in design view).

Templates allow you to have a consistent design which can be edited easily accross all pages without the use of server-side inclusions. You can even set properties in a template to style your menu, such as specifying a item you want highlighted for a page or leave out peices you dont want present.

Seb Hughes
January 19th, 2006, 01:12 PM
well.. to include another file in a PHP file, you can just do this:


<?php include ("nav.php"); ?>

That would include the file nav.php in the file, and whenever nav.php was changed the content would change as well :)

You could also use SSI (server side includes), but PHP is perfect for that kind of task as well

I concur.

DDD
January 19th, 2006, 02:24 PM
I know on a windows server you could just include the html in a .inc file or even a .asp file. No need to learn the language just include the snippet of html. Is this not the case in PHP as well?

I actually use templates, nested templates, includes and css.....poor mans cms...lol

antizip
January 19th, 2006, 03:13 PM
php include is the way to go

... and DW MX2004 shows you the included file (php,asp) in design view (previes)

anif
January 19th, 2006, 07:14 PM
You can Use SSI. It's exactly thesame as HTML, but you save the files with *.shtml extension. Then you can do the header/menu in one file, the content in another file and the footer in another file. So all you do is include the header and footer files in content file.

Good thing is with SSI, you are not learning anything new. You just include the files like this for example:

<!--#include virtual="header.shtml" -->

FrankieB
January 19th, 2006, 07:19 PM
I'd do it in a DW template with CSS (no php). I wouldnt use PHP because, A) you dont know it that well. Though I would suggest learning it, I dont know if this is the best place to (include alone might not cut it depeding on file placement and references). And B) because in a template, you arent going to be able to visually see your php when editing in design view which isnt going to help you any when developing page content (in design view).

Templates allow you to have a consistent design which can be edited easily accross all pages without the use of server-side inclusions. You can even set properties in a template to style your menu, such as specifying a item you want highlighted for a page or leave out peices you dont want present.

Best advice here. Senocular knows his ****.

senocular
January 20th, 2006, 08:45 AM
DW also has library items which act like includes. But, unlike simple includes, DW will automatically update references when they change. You're also not dealing with the additional stress on the server from parsing a web document before serving it. Though, really, Im sure that wouldnt be an issue with you.

I will say the one advantage of includes would be that if the include is edited, only the include would need to be re-uploaded to the site rather than all affected pages which would be the case with DW templates.

sebus
January 20th, 2006, 01:05 PM
thx i used dw templates but i'm getting some weird things going on. I started a new thread on this issue if someone can please help me i would appreciate it.