Solved

Editable tag attributes

Posted on 2006-06-23
20
333 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
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
 
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Display recordset field HTML encoded 21 55
Problem to run file 9 126
Using YubiKey with REST API application 2 123
Adding a hidden div to each row in a table 6 85
Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

789 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