Solved

Editable tag attributes

Posted on 2006-06-23
20
336 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 
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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

688 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