SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Addict gthorley's Avatar
    Join Date
    Oct 2000
    Location
    Canada
    Posts
    392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I decided to try the templates function of DW but am encountering major difficulty. I am using DW 3.0

    The problem is the template doesn't update my pages associated with the template. I have made all areas editable.

    As a test to see what I was doing wrong I created a new page and placed a table and some links all within a large table. I used this to make a template. I made the large table editable. I then made 2 more files from the template.
    I then made some changes to the template I added a small line of text and place some text in the inner table. Clicked update and get the following
    Updating C:\MyWebPages\dw_test\
    Done.
    files examined: 3
    files updated: 0
    files which could not be updated: 0
    total time: (0:00:01)
    I then saved the file and it asked whether to update templates used in file. Clicked update got the same message as above.
    Made another change this time using modify/page properties changed link colours and background clicked update same as above no changes saved file it asked and I said update and this time it updated the files. It seems it will update changes made to page properties but not if I add a table or some text.

    Anybody have any idea why this template function isn't working for me?

  2. #2
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have never used this feature of DW. As a matter of fact, I don't use DW much either. One suggestion is to use Server Side Includes (SSI) instead. They are the same thing (I guess) or at least accomplish the same purpose and they are easier to use.

    <!--#include virtual="path/to/file.txt" -->

    You can include ANY chunk of text. I would make a header.html and a footer.html for sure. Or you can use it to include little "modules" as I call them. Just little chunks of code that are used on multiple pages.

    Pages would need to have a .shtml extensions (unless you have access to the Apache config files)

    Couldn't be easier.

    here is a link to an SSI tutorial.

    http://bignosebird.com/ssi.shtml
    Last edited by creole; Mar 12, 2001 at 13:51.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  3. #3
    I'm baaaaaaaaaaaaack! Fluffykins's Avatar
    Join Date
    Aug 2000
    Location
    Manchester, UK
    Posts
    1,046
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I might have an idea...

    If the new bits and pieces you're adding are part of an editable region of the template it won't update. For example if all your pages have titles and you change the title on the template, it won't update because the title is set to be different on each page.

    Check in the HTML that the new content you're adding isn't within <!-- #BeginEditable "regionname" --> and <!-- #EndEditable "regionname" --> elements.

    I had a problem once where somehow the entire page became and editable region and changes I made to any of it didn't take effect. Keep at it though, they're well worth the effort once you've got them working properly.

    Ady
    v-technologies - Freelance Goodness.

  4. #4
    Blissed off
    Join Date
    Feb 2001
    Posts
    422
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You should definitely move up to Dreamweaver 4.0... It's much nicer overall...

  5. #5
    SitePoint Addict gthorley's Avatar
    Join Date
    Oct 2000
    Location
    Canada
    Posts
    392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Fluffykins
    I might have an idea...

    If the new bits and pieces you're adding are part of an editable region of the template it won't update. For example if all your pages have titles and you change the title on the template, it won't update because the title is set to be different on each page.

    Ady
    I made the whole thing editable I guess that is the problem. Confusing, so if you want to be able to edit the template make it non-editable. That sure makes sense. The crazy thing is when you first create the template and load it you get a message box warning you that you have no editable regions. So I made it all editable. Oh well tomorrow I will test it out again.

  6. #6
    SitePoint Addict Macromedia's Avatar
    Join Date
    Nov 2000
    Location
    New York, NY
    Posts
    249
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Uh, that doesn't really make sense. You can't really have a template that is all edible...
    -Nick

  7. #7
    I'm baaaaaaaaaaaaack! Fluffykins's Avatar
    Join Date
    Aug 2000
    Location
    Manchester, UK
    Posts
    1,046
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Macromedia
    Uh, that doesn't really make sense. You can't really have a template that is all edible...
    Well I suppose in theory you could... It'd mean you could use a template to define parts of a page right at the beginning, for example an embedded style sheet, page title, link colours etc but then if you went back and changed the template, pages it would apply to wouldn't update to reflect the changes. It kind of defeats the object I know.

    The trick with templates is to design the page first THEN add the editable regions in. Also remember that if you delete the text representing a region - for example {body} you're not deleting the region itself. For that you need to go into Modify > Templates > Unmark Editable Region. I'm pointing these things out because they confused me a lot when I was just starting out using DW Templates

    Ady
    v-technologies - Freelance Goodness.

  8. #8
    SitePoint Addict gthorley's Avatar
    Join Date
    Oct 2000
    Location
    Canada
    Posts
    392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Fluffykins

    The trick with templates is to design the page first THEN add the editable regions in. Also remember that if you delete the text representing a region - for example {body} you're not deleting the region itself. For that you need to go into Modify > Templates > Unmark Editable Region. I'm pointing these things out because they confused me a lot when I was just starting out using DW Templates

    Ady
    Adrian I still am getting confused and before I try testing again I would like to ensure I am going about it the correct way.
    The trick with templates is to design the page first THEN add the editable regions in.
    So my test page, I create a page in DW save it then save it as a template. I am now working on the template (which say is a menu and title bar with a large table to enter in data representing different areas of a site. My title and menu are going to stay constant and I will not be editing them. So I select them and "mark selection as editable" ctrl+alt+w. The area of the table where I will want to make changes to as I make new pages from the template I dont select and do anything to. Hope I am right so far. So I make up two new pages using "new from template" putting my info in the table. Now I decide to add a new item to the menu. But alas I have made this section of the template editable so when I make the change on the template it doesn't update my 3 files. What I must do I guess before updating them is select and "unmark the editable region" Am I right or totally off base.
    Do I actually do the oposite to the above. Make the Table which I will complete with data editable ctrl+alt+w leaving the menu and title alone as those are probably the only constants that will need changing as a group.

    I think my problem is I am not understanding the term editable properly.

    Anyway I will try out my test.

  9. #9
    SitePoint Member
    Join Date
    Mar 2001
    Location
    Pezenas, South of France
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Templates drive people crazy with DW, all versions.

    My approach is as follows.

    Draw the page design on a piece of paper - header, footer, menu bar, menu text, central display area, etc - and note where items will change. Eg central display on every page, menu bar perhaps applies to groups of pages.

    Build that page in DW straight.

    Save it. Save it again as a template.

    Within the template make any area which will apply to more than one page a library item. Select it and create a new library item.

    Within the template make any area which will differ on every page and editable item. Select it and make it an editable region. At this point I always move title, description and metatags into the Head editable region. I also do all the links to css and js files and include an empty reference to javascript just before the </head> This last curiosity is to allow you to use behaviours on derived pages!!!

    Now you have a master template from which you can derive sub templates if you need minor differences for different areas on your site.

    From the template, derive a page. it will always show you the rubbish content in the editable area which you left in original template.

    For a new area, derive a page, disconnect it from its template, create a slightly different library item for, say, thenew menu bar, relink the library item, save the page and again as a new template - and create all those pages.

    Terrible to start with, but when you get very quick.

    If you want, I will describe how to turn all that into SSI. I create the site like this and - once the client has settled down a bit - then convert it to SSI

    HTH
    Tony

  10. #10
    SitePoint Addict gthorley's Avatar
    Join Date
    Oct 2000
    Location
    Canada
    Posts
    392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Tony
    I really appreciate your help and will go back and try to get the hang of this.

    Totally O.T.
    If not I might have to come and visit you so you can show me how. How is the weather at this time in Lanquedoc-Roussillon.
    It is a beautiful region and my wife wishs to return and visit Albi to see the Toulouse-Lautrec collection.

  11. #11
    SitePoint Member
    Join Date
    Mar 2001
    Location
    Pezenas, South of France
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Chill in the air now since it has just got dark but today was semi clouded with about 20C at lunch time - Navarin of Lamb and some Faugeres in the sunshine outside a nearby restaurant.

    Work is fascinating but one can get too much of a good thing!!
    Tony

  12. #12
    SitePoint Member
    Join Date
    Mar 2001
    Location
    Pezenas, South of France
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    raham

    My long winded post did not make this bit clear enough.

    The Javascript space that you make so that you may add behaviours in the editable regions must itself be editable. That is you end up with a chunk which looks like the following. Ritual requires the second bit although I have never seen Dreamweaver over write it or delete it. May be one day.

    <mm-editable>
    <script>

    </script>
    </mm-editable>

    <mm-editable>
    <!-- This is here for Dreamweaver to throw away -->
    </mm-editable>

    HTH

    Tony
    Tony

  13. #13
    I'm baaaaaaaaaaaaack! Fluffykins's Avatar
    Join Date
    Aug 2000
    Location
    Manchester, UK
    Posts
    1,046
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by gthorley


    Adrian I still am getting confused and before I try testing again I would like to ensure I am going about it the correct way.

    So my test page, I create a page in DW save it then save it as a template. I am now working on the template (which say is a menu and title bar with a large table to enter in data representing different areas of a site. My title and menu are going to stay constant and I will not be editing them. So I select them and "mark selection as editable" ctrl+alt+w. The area of the table where I will want to make changes to as I make new pages from the template I dont select and do anything to. Hope I am right so far.
    Erm, nope that's completely the wrong way round. Sorry if i've not made it entirely clear in my previous posts. Try this definition:

    Editable Region: Part of the page you want to be able to change and/or to be different in the various pages of the site.

    In your case the only editable region you'll need is the main table where you want the content to go. That bit is 'editable' meaning you're free to change it in all the pages - ie add the main body text and images into the page. The menu section, title etc we don't want to be editable because we want them to be constant throughout all the pages. You seem to have gotten the idea, but just got it backwards. Just remember that editable regions are the bits you want to be able to alter / add content to and you should be OK.

    Library items are some quite different, and we can deal with those once templates are sorted!

    Any more problems keep 'em coming, that's what we're here for

    Ady
    v-technologies - Freelance Goodness.


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
  •