by-expession

Expression Web Resources

DWT woes. Dynamic templates don't seem to work for me.

Latest post 11-02-2007 1:30 PM by smithdoug. 7 replies.
  • 10-09-2007 6:35 PM

    DWT woes. Dynamic templates don't seem to work for me.

    I'm building a site that uses 6 different page formats but with a masthead (with two menu bars) and footer (with another menu bar) that are common to all pages and all page formats. Since it doesn't seem to be possible to make templates of templates I reconciled myself to making 6 different dynamic web templates and then build pages from those. Then, when I add another menu item or two in the masthead, say, I will need to add it to each of the 6 templates but the changes should then propagate to all of the pages in the site. Not as elegant as being able to make only one change in one template, but manageable.

    Problem is: Most of my pages uses dynamic effects. Image swaps and changes in display properties between "none" and "block" to change what information is being displayed. This makes for a very clean and user-friendly interface for the viewer, but it appears to be incompatible with dynamic web templates. I need to adjust the display properties of the divs while building the pages by modifying the styles, but expression web won't let me do this since the styles are in non-editable regions of the page head. I tried removing the template from the page to make the necessary display changes and then adding it again and end up with a real mare's nest. I've tried without success to add code by hand to make the div id styles editable.

    Is there a solution? Or do I junk the notion of using dynamic web templates and be prepared to spend a day or two editing every single page when I need to change the header or footer?

  • 10-09-2007 11:19 PM In reply to

    • cdwise
    • Top 10 Contributor
    • Joined on 12-22-2006
    • Houston, TX
    • Posts 541

    Re: DWT woes. Dynamic templates don't seem to work for me.

    Have you considered one DWT with includes for the parts that vary?

    Cheryl D Wise MS MVP Expression Instructor: starttoweb.com

  • 10-10-2007 1:04 AM In reply to

    Re: DWT woes. Dynamic templates don't seem to work for me.

    Cheryl, thanks for your quick response. Knowing you're around helps reduce the anxiety. 

    I don't quite see how your suggestion would work since the things I need to change are style properties that are in the page head and therefore uneditable. I tried to manually change those style sections by inserting some <!-- #BeginEditable "uppertext2" --> lines, etc. but without success.

    I need to be able to have sections of the page (divs) set to display.block (or no display attribute) in order to insert the appropriate content, and then change the display attribute to "none" so that it is hidden until the visitor clicks the appropriate tab that makes the non-displaying content (div) display (and the content that was displaying beforehand become non-displaying).

    Perhaps it would be possible to make the navigation elements in the two nav bars in the masthead (and the one navbar in the footer) includes. They are unordered lists styled to create horizontal navigation elements. Then, if and when I need to add another element or two, I presume that I could change the content of the includes and the changes should propagate throughout all the pages in the site. Does this make sense? I would then be able to at least edit the menu options globally without using DWTs. Of course, if I decide to re-design the other graphic elements in the masthead I would be sunk.

    The sites I see that do what I'm attempting to do are all dynamic sites, whereas mine is static. But it's clear that the actions I'm seeking to achieve are all executed by client-side scripts rather than by the server. Perhaps it's possible to do these kinds of things with Master Pages but not with Dynamic Web Templates. This site will need to evolve into a dynamic database-drive site, but that's probably well beyond my present capabilities.

     By the way, Cheryl, I love your book. It's always the first resource I check.

  • 10-25-2007 10:03 PM In reply to

    • cdwise
    • Top 10 Contributor
    • Joined on 12-22-2006
    • Houston, TX
    • Posts 541

    Re: DWT woes. Dynamic templates don't seem to work for me.

    Thank you for your comment on my book.

     I think what you need is a script that changes the display rather like the one used for the menu on the main site http://by-expression.com or are you looking to do something like the Ajax Panels? Either way I'd look to javascript to trigger your different display states.

    I want to caution you about using display: none since it also hides the content from screen readers you normally for accessiblity you would have the content display by default and use javascript to hide it or position it off the page until called.

    Cheryl D Wise MS MVP Expression Instructor: starttoweb.com

  • 10-26-2007 10:01 PM In reply to

    Re: DWT woes. Dynamic templates don't seem to work for me.

    Thank you Cheryl,

    I published the site earlier today. Hooray! My very first effort. It needs a great deal of work, but it is a start. There's still a little bit of weirdness in the way a couple of things display in Firefox. I don't have access to a Mac, so I have no idea what Safari does.

    I took your advice to look into includes (thank you very much!), read what both you and Tina had written about them, and even downloaded one of the add-ons you suggested elsewhere. That was just the ticket. I'm using includes for the navigation bars so that I can add or change elements over time, with the changes propagating through every page in the site. And if I need to adjust the display characteristics, that should be quite possible since the styles are in attached external style sheets.

    I presume that it would be possible to use includes for all kinds of content which one might want to put in various parts of the site and be able to change or edit over time. Altogether a very powerful technique, and I'm at a loss to explain why we don't hear more about it.

    I had mistakenly thought that I could at least use a dwt with only the header and footer of my pages and then adapt for whatever content I would need to place in between. But the dwt prevented me from adding any new styles. My cobbled-together solution was to build each of the five or six basic page layouts that I use and place copies of those in a page layout folder. Then, for each page, pull out the appropriate layout page, save as the appropriate file name, then add content and adjust syles as needed.

    Not the most elegant approach. But I realized some while ago that this needs to become a database-driven dynamic site. Now that I've gotten my fingers dirty with html, CSS and a tiny bit of scripting, I feel ready to begin to learn how to do that. My wife bought be the new Head Start book on SQL for my birthday a couple weeks ago. Perhaps that's the place to begin.

    Anyway, thanks for your suggestion to consider "includes". It was a big, big help.

  • 10-27-2007 11:29 AM In reply to

    • cdwise
    • Top 10 Contributor
    • Joined on 12-22-2006
    • Houston, TX
    • Posts 541

    Re: DWT woes. Dynamic templates don't seem to work for me.

    You should be able to add styles in both the head section and in your external stylesheet. Use one DWT and includes for what changes. If it is on every page in the site it should be in the DWT.

    I tend to prefer server side includes so that I only have to update the page that is included and publish it. That's what I do for the menu and submenus on the main by-expression site.

     Have you looked at Tina's ebook on DWTs? There is a default region in the head section of the page that sytles and page level scripts should go into but since it is for the title I think a second one should be added. If you look at the http://by-expression.com/samples/pub dwt you will see that I included a separate section in the head section of the page. You need to insert an empty style block or comment to keep it from collapsing but that provides a way to add a style block inside of a DWT and below the linked stylesheet to over ride if necessary styles in the stylesheet.

    Cheryl D Wise MS MVP Expression Instructor: starttoweb.com

  • 11-01-2007 9:12 PM In reply to

    • Tina
    • Top 10 Contributor
    • Joined on 12-22-2006
    • UK
    • Posts 45

    Re: DWT woes. Dynamic templates don't seem to work for me.

    Cheryl mentioned my Expression Web DWT Ebook that might help you understanding dwts a little more. I suggest also reading and implementing my Free Setting up Expression web Ebook

     

    hth Tina

     

  • 11-02-2007 1:30 PM In reply to

    Re: DWT woes. Dynamic templates don't seem to work for me.

    Thank you, Tina. I will do so. Actually, it was your and Cheryl's advice regarding Includes that gave me a workable solution, although not as elegant as if I had been able to find a way to make dwts work. Eventually, though, I suspect that a dynamic database-driven approach will be the ultimate approach. For a lot of reasons, but certainly being that fact that it's evidently possible to have parent-child relationships in master pages; or master pages built from master pages.
Page 1 of 1 (8 items) | RSS
Powered by Community Server (Commercial Edition), by Telligent Systems Sponsored by: Start to Web
@ 2005-2008 Cheryl D Wise