View Full Version : Editable Attributes

09-27-2010, 12:04 PM
I am using editable attributes with my template. The problem I am having is that whenever I change the template, the contents of the editable attribute are removed. Is there any way to indicate that current values should be retained?

Thanks -


09-27-2010, 06:39 PM
removed from where?

09-27-2010, 06:56 PM

I have a section of navigation, which is a list of links. From this list, I want the link that refers to the current location to be highlighted. Included in the anchor is class="@@(active_StaffResearch)@@" which allows me to assign a class of "active" to the link to Staff Research so that when the user is visiting a link within the Staff Research area, the link will be displayed differently. I assign classes to the proper item within the list, which helps the user know where they are within the site, i.e.

<li><a href="foo.htm (http://www.dreamweaverclub.com/forum/view-source:file:///C:/NonWebServer/STPages/Version_a1/smo/smo.htm)" class="active">Staff Research</a></li>

Unfortunately, if I change something within the template, when the items are updated, the class is removed, so it looks like this:

<li><a href="foo.htm (http://www.dreamweaverclub.com/forum/view-source:file:///C:/NonWebServer/STPages/Version_a1/smo/smo.htm)" class="">Staff Research</a></li> Apparently, @@(active_StaffResearch)@@ allows one to enter a value within the templated section of a page, but that value is not protected when the template is updated and needs to be reentered. I am at the beginnings of working on a large website (thousands of pages), so although reentering the information is okay for a few dozen pages, when things get into the thousands then this will not be reasonable.

The question is how (or "if") the value in an editable attribute can be retained when the template is updated.

Cheers -


09-27-2010, 07:33 PM
That sucks!

Here's what I do but it may be a bit difficult on a very large site. I make the the ID attribute of the body tag editable (which isn't affected by template updates).

Then in the template I assign each menu item a unique class home, contact etc.

Then I set the body ID to the same name as the appropriate class.

Finally, I a style rule for each page:

#home .home, #contact .contact, etc. {rules for the current menu item}

But with 1000s of pages, that may be prohibitive.

One question. Why use DW for a site of that size why not a Content Management System?

09-27-2010, 08:07 PM
That's certainly a solution, but indeed on a large site might induce some difficulties.

Actually, we are using Zope and I am plugged into it using Dreamweaver. The current website was put together around 2000 and has only been added to, not updated. This means that everything is put together using tables and spaces gifs. I am in the process of working on things one section at a time, separating content and presentation, and changing things to HTML5. One of the advantages with using Dreamweaver is that I can keep track of what I am doing a bit easier (I do not know Zope very well yet), and some things like standardizing file names can be done easily through the site cache.

Cheers -