SitePoint Sponsor

User Tag List

Results 1 to 11 of 11

Thread: To template or not to template?

  1. #1
    SitePoint Addict
    Join Date
    Jul 2011
    Posts
    363
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    To template or not to template?

    Hey all,
    I just converted a site to CSS tableless, and a co-worker suggested to me that a Dreamweaver template might be good to add to it. Now I understand what a Dreamweaver template is, and how it would be beneficial with the old table layouts and font-tags, that way you can make sitewide design changes in the template and not have to change a bunch of font tags and table widths etc hundreds of times. That old-school approach to layout is what I suspect DW templates were created for, no?

    But in modern web design, doesn't the CSS do the same job, keeping the layout data in one place, rendering DW templates obsolete? What are your thoughts? Does anyone here use templates as an addition to CSS layout? Maybe I am missing something, but can someone tell me a reason I should be using them?

  2. #2
    SitePoint Guru
    Join Date
    Jan 2007
    Posts
    902
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Dreamweaver templates synchronize uniform elements. For example if you update the navigation in the template every page on your site is changed when you run the template update, saving you from having to manually change every page on the site. This same effect can be done other ways. Dreamweaver templates are better than flat HTML. Though they are pretty crappy. A hundred page site can take hours to update and verify. Version control issues are a nightmare.

    Another approach is to use includes. This can be done with PHP, ASP, or SSI. My preference is PHP. Here is a tutorial. PHP Tutorial - Include File

    The 1.5 hour project with Dreamweaver templates will take 15min using includes.

    E

  3. #3
    SitePoint Wizard bronze trophy Black Max's Avatar
    Join Date
    Apr 2007
    Posts
    4,029
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    I don't use DW any longer, so I can't speak with direct knowledge, but if the DW templates are table-driven, then any use of them would be a tremendous exercise in futility. Redo the site the right way, using CSS-driven structure and losing the tables entirely.

  4. #4
    SitePoint Wizard bronze trophy Black Max's Avatar
    Join Date
    Apr 2007
    Posts
    4,029
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Eruna makes some good points (that post came up while I was writing mine ) but if you're worried about across-the-board updating of hundreds of pages, you're better off using a modern CMS such as Wordpress, Joomla, or Expression Engine. Those DW templates are entirely obsolete.

  5. #5
    It's all Geek to me silver trophybronze trophy
    SitePoint Award Recipient ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, Australia
    Posts
    20,007
    Mentioned
    217 Post(s)
    Tagged
    3 Thread(s)
    Yes, I would agree with the above: either use a CMS, or at least use PHP Includes. That Dw stuff is absolutely horrid. I've had to work with them once, and once was more than enough.

  6. #6
    SitePoint Addict
    Join Date
    Jul 2011
    Posts
    363
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Black Max View Post
    I don't use DW any longer, so I can't speak with direct knowledge, but if the DW templates are table-driven, then any use of them would be a tremendous exercise in futility. Redo the site the right way, using CSS-driven structure and losing the tables entirely.
    Right. I redid it using CSS layout, and that is what caused me to ask the question. Personally, rather than using a template, especially since I am using simple lists, if I wanted to change the navigation, couldn't I just use find/replace? That's how I have always done it. I guess that can come with its own downsides, but it is hard to screw up a find and replace on a simple list. I'll check out the includes though.

  7. #7
    It's all Geek to me silver trophybronze trophy
    SitePoint Award Recipient ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, Australia
    Posts
    20,007
    Mentioned
    217 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by sdt76 View Post
    if I wanted to change the navigation, couldn't I just use find/replace?
    If it does this for the whole site, I guess so, but it's far less efficient than having the code in one place only and feeding in to all pages. That's the beauty of includes. It's similar to an external style sheet, where the one set of styles feeds in to all pages.

  8. #8
    SitePoint Addict
    Join Date
    Jul 2011
    Posts
    363
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah I'm gonna check that option out. Sounds like a better solution.

  9. #9
    SitePoint Guru
    Join Date
    Jan 2007
    Posts
    902
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Black Max, I agree with you. A CMS is the best way to go. I haven't built a site without one for years. They can actually take less time to build once you get the hang of it.

  10. #10
    SitePoint Wizard bronze trophy Black Max's Avatar
    Join Date
    Apr 2007
    Posts
    4,029
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by eruna View Post
    A CMS is the best way to go.
    They can be, depending on what the site is supposed to actually do. Their downside is that, depending on the CMS you're using, you can be restricted to a limited number of templates and thus get the "generic CMS site" look. And sometimes they constitute "too much solution" for a site. The OP wasn't specific enough about what his revamped site is to know whether a CMS is the right solution for him.

  11. #11
    SitePoint Guru
    Join Date
    Jan 2007
    Posts
    902
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I've never had any problems like you are describing. The CMS systems I build are completely design neutral. Templates can be created as needed. Its a matter of using the correct CMS for the project and customizing it appropriately. The only time I wouldn't use one would be if the client never needed to edit it and it was less than 10 pages.

    E

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •