Solved

Editable tag attributes

Posted on 2006-06-23
20
328 Views
Last Modified: 2013-11-19
Just got back to DW after a long break and am now using DW MX 6.0 and just trying to get up to speed. One of the things that used to annoy the hell out of me before was the seeming inability (easily at any rate) of defining editable regions that could appear inside attributes. When i saw the phrase mentioned in my subject in the help files, i thought - progress at last. However, there certainly doesn't seem any easy way of populating my 'editable' attributes. Here's the item:


<!-- #BeginLibraryItem "/Library/order-table.lbi" --><!-- TemplateParam name="name" type="text" value="form1" --><!-- TemplateParam name="action" type="text" value="" --><!-- TemplateParam name="href" type="URL" value="javascript:alert('Not implemented yet')" -->

<form name="@@(name)@@" method="post" action="@@(action)@@">
  <table border="0" cellpadding="0" cellspacing="5">
    <!-- order elements -->
    <tr>
      <td height="25" class="button"><span class="buttonText"><a href="@@(href)@@">add
        to cart</a></span></td><td valign="center"> <input name="amount" type="text" id="amount" size="3" maxlength="5"></td><td class="caption"> how many?</td></tr>
  </table></form><!-- #EndLibraryItem -->

Indentation seems to be as i remember - lousy - is there any way to fix this.

The main thing though is: how do i get those attributes in there without going in and hacking at the source?
0
Comment
Question by:CEHJ
  • 10
  • 9
20 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 16979467
Hi CEHJ,

1) Just asking to be sure: Is this library item applied to a page with an existing template (you're using this as a nested template, right)?

2) I don't see the  <!-- InstanceBeginEditable name="EditRegionWhatever" --> and <!-- InstanceEndEditable --> in the above snippet which should be there for proper nested template syntax.  Here's the relevant technote:

http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_16416

3) Indentation:  Looks like standard DW indentation to me, but because you mentioned MX 6, I know there is a known issue with code indentation:

http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_16726

Does the above apply to you?  If not, they have improved the source code tools in DW 8, maybe it is time to upgrade...

0
 
LVL 86

Author Comment

by:CEHJ
ID: 16979476
Well actually i was trying to use it as just a library item, but maybe those can't be parameterized?
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 16979486
Nope.  I'm pretty sure you need to "templatize" is to get that functionality to work.  Try adding the editable region tags (#2) anyway and see if that fools DW into doing what you want...
0
 
LVL 86

Author Comment

by:CEHJ
ID: 16979498
Well i probably shan't at the moment, since i'm now using the editable attributes in a straight template. But - and i can barely believe this is the case - suppose i have

<input type="hidden" name="a" value="x">
<input type="hidden" name="b" value="y">

am i right in thinking that DW 6.0 only allows me to parameterize *one* of those since the values have the same name(!)?
0
 
LVL 86

Author Comment

by:CEHJ
ID: 16979501
>>since the values have the same name

IOW, the attributes have the same name
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 16980737
Eh?

Why would this not work:

<input type="hidden" name="a" value="@@(x)@@">
<input type="hidden" name="b" value="@@(y)@@">

or

<input type="hidden" name="@@(a)@@" value="x">
<input type="hidden" name="@@(b)@@" value="y">

Where is the value the same?  Am I missing something?
0
 
LVL 86

Author Comment

by:CEHJ
ID: 16981574
>>Where is the value the same?

The *name* of the attribute is the same. The world 'value' was misleading, but it *is* the name of the attribute in question
0
 
LVL 86

Author Comment

by:CEHJ
ID: 16990517
>>Why would this not work:

I'm winding this q up now and would be grateful if you could confirm or refute my findings
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 16994515
Sorry, I have some real-life issues to handle and haven't been able to test yet.  Can you give me one more day to set up a template of my own and test your theory?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 86

Author Comment

by:CEHJ
ID: 16996068
Yep. Just use the same <input> tags as i did if you would please
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 16996079
From the original question or these:

<input type="hidden" name="a" value="x">
<input type="hidden" name="b" value="y">

Which element do you want me to templatize?
0
 
LVL 86

Author Comment

by:CEHJ
ID: 16996103
That'll do. I'd like you to templatize *both* elements on the attribute 'value'
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 16996122
Ok, I'll try it when I get home later tonight...
0
 
LVL 86

Author Comment

by:CEHJ
ID: 16996173
Thanks
0
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 500 total points
ID: 16997883
Something like this?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- TemplateBeginEditable name="doctitle" -->
<title>Untitled Document</title>
<!-- TemplateEndEditable --><!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable --><!-- TemplateParam name="value" type="text" value="x" --><!-- TemplateParam name="value2" type="text" value="y" -->
</head>

<body>

<!-- TemplateBeginEditable name="EditRegion3" -->
<div>
<p>This is a test form:</p>

<p>Blah</p>
</div>
<!-- TemplateEndEditable -->
<form action="" method="post" name="form1" id="form1">
<input type="hidden" name="a" value="@@(value)@@">
<input type="hidden" name="b" value="@@(value2)@@">
</form>
</body>
</html>
0
 
LVL 86

Author Comment

by:CEHJ
ID: 16999035
Well, does that work in the editor through the Modify menu?
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 17002576
Yup.
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 17002582
I should qualify that.  It works in the editor with DW 8.  YMMV.
0
 
LVL 86

Author Comment

by:CEHJ
ID: 17254955
So sorry about the wait Jason - have increased the points. Thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now