PDA

View Full Version : Is it ok to leave empty div tags in my template


liljuvu73
08-11-2010, 09:21 PM
Hi Guys,

I am setting up a template file for my web site at the moment and i have a question about whether it is common practice to leave empty div tags containg empty editable regions in my template file.

The reason I am asking this is that my site will have two basic page styles, around 50 product pages with a basic two column layout and 5 or 6 company profile pages with a sigle column layout.

I want to use the same template for both but the only way i can think of doing it is to set up the template with both single and two column div tags.

On the product pages i would simply leave the single column div tags empty so they would not show up.

Is this and ok thing to do.

Any tips would be appreciated.

Thanks

James

DWcourse
08-11-2010, 11:06 PM
You might look into using optional editable regions in your template or creating a nested template.

Corrosive
08-12-2010, 06:15 AM
Even if you leave a div tag empty it will have a style attached to it, probably with a width at least (and maybe a float) so it will show up anyway. It is also redundant mark-up. Suggest you follow JC's advice :)

liljuvu73
08-12-2010, 07:02 AM
You might look into using optional editable regions in your template or creating a nested template.

Thanks for that JC I will do some reserach on them.

liljuvu73
08-12-2010, 02:27 PM
Even if you leave a div tag empty it will have a style attached to it, probably with a width at least (and maybe a float) so it will show up anyway. It is also redundant mark-up. Suggest you follow JC's advice :)

Thanks Corrosive.

Ricky55
08-12-2010, 10:50 PM
Use PHP includes, DW templates are a bit lame IMO.

Includes are far easier to work with and you don't need DW to work with them.

See Corrosives video tut. You don't need to know PHP at all to use includes.