Editable attributes not possible in nested templ?

message from kronman on 22 Jul 2004
Hi all,
I'm currently evaluating DW MX 2004 and doing a small website using nested
templates. I want the second menu level items class attribute to be editable,
so I can make them bold to show the user where they are in the hierarchy.

When I try to make the class attribute of table cells in the second menu level
editable in my nested template DW consequently "steals" my doctitle editable to
put the template directives in, so things are messed up, because my pages acts
as if the editable region doctitle is missing and sends me an error report on
updating. Furthermore, the doctitle is not editable anymore.

Does any clever person know what's going on here? I have attached some code
from my main template and the nested template below.

Grateful for any help,
Ulf

Main template code:

<!-- #BeginEditable "doctitle" -->
<title>Bildmakarna at KI - Photographers and experts in scientific poster
production</title>
<!-- #EndEditable -->

Nested template code after inserting editable attribute:

<!-- InstanceBeginEditable name="doctitle" -->
<title>Bildmakarna at KI</title>
<!-- TemplateParam name="menu_photo" type="boolean" value="false" --><!--
InstanceEndEditable -->

Notice how the TemplateParam has been made a part of the
InstanceBeginEditable, which seems to make DW template handling confused.
 
Murray *TMM* replied to kronman on 22 Jul 2004
This is not a good way to start out with DW. Nested templates can become
quite complex in a hurry. Most sites don't need to use nested templates, by
the way, but we can discuss that later.

Actually, this is not the best way to do that. Make each of the second menu
level items have a unique class, like 'button1', 'button2'. Then embed a
stylesheet in the editable region in the head of the document where you can
specify which button, e.g.,

<!-- InstanceBeginEditable name="head" -->
<style type="text/css" -->
<!--
buttonx { blah }
 
Murray *TMM* replied to Murray *TMM* on 23 Jul 2004
I have a much better way. Look at this site - http://www.ent-sys.com and
browse through the pages. It's all controlled by a single template here -
http://www.ent-sys.com/Templates/page.dwt. Can you see how I'm doing it?

Yes, but editable attributes is a way messier way to do it than this very
clean method. Get over your fear of code. You will never progress in your
page development skills until you do.

But if that still bothers you, then editable attributes in a non-nested
template will work exactly the way you want.

DW should not be putting parameters definitions into editable regions in the
first place. They are NOT editable entities, and in fact, should NOT be
edited in order for them to function properly. The parameter declarations
are normally placed in the head of the page, just above the </head> tag. I
will have to investigate why this is not happening for you in a nested
template situation.

Have you tried the editable region thing in the PARENT template and not the
child?

In addition, I note that you are using a template containing DW4 level
markup -
<!-- #BeginEditable "menu_selection" -->xxx<!-- #EndEditable -->

This is probably a bad idea. If I were you, I would upgrade the markup on
this page so that it was consistent with DMX level throughout - you will
find a tutorial on how to do that here -
http://www.dreamweavermx-templates.com.

If you want to communicate directly with Macromedia, you will have to
contact them directly. MM staff visit this forum irregularly, and with >600
posts a day, it's not likely they will find this one.
 

Archived message: Editable attributes not possible in nested templ? (Macromedia Dreamweaver Web Design)