Hi,

I'm trying to write a very simple VTM file for a very simple custom tag. I'
ve had to name the vtm file "cf_Relocate.vtm" from the original name I gave
it, "Relocate.vtm", in order for Tag Insight to work when I call it as a
custom tag, i.e. <cf_relocate field=...>. Now, if I were just calling
"<relocate field=...>" then I would simply need to name it "Relocate.vtm"
and everything would work.  However, I'm calling it as a custom tag, which
is where the "cf_" prefix comes in.

Problem is that I get an error when I Right Click > Edit Tag on <cf_Relocate
field=.... > upon pressing OK on the dialog box that appears. The error is
an "invalid expression token "_"". Basically, it trips up on the "_" found
throughout the <TAGLAYOUT> area of the VTM, which corresponds to the _ in
cf_Relocate.  I'm concerned why there are no VTM files in the tutorials with
the "cf_" prefix and presume that's where I'm having problems. I need to
know if / how to get around this, or whether I'm doing things completely
wrong here.

Any ideas are very much appreciated. Thanks in advance,
Andy

This is the syntax of the custom tag, relocate.cfm:
<cf_Relocate field="form.fieldname" redirect="gohereinstead.cfm">

This custom tag takes the place of the following code:
<cfif isdefined("form.fieldname")>
 <cflocation url="gohereinstead.cfm">
<cfif>

This is the syntax of the vtm file, cf_Relocate.vtm:
<TAG>

 <EDITORLAYOUT HEIGHT=225>
  <CONTAINER
     NAME="MainTabDialog"
   TYPE="TabDialog"
   MAXWIDTHPADDING=0
   MAXHEIGHTPADDING=0
   WIDTH=MAXIMUM
   HEIGHT=MAXIMUM>

   <CONTAINER
      NAME="TabPage1"
    TYPE="TabPage"
    CAPTION="CFLocate Tag">

       <CONTAINER
        NAME="Panel1"
      TYPE="Panel"
      DOWN=5
      RIGHT=10
      WIDTH="MAXIMUM"
      HEIGHT=125>

     <CONTROL
      NAME="lblField"
      TYPE="Label"
      CAPTION="Field:"
      DOWN=17
      RIGHT=10
      WIDTH=50>
     <CONTROL
      NAME="txtField"
      TYPE="TextBox"
      ANCHOR="lblField"
      CORNER="NE"
      WIDTH="MAXIMUM">

     <CONTROL
      NAME="lblRedirect"
      TYPE="Label"
      CAPTION="Redirect:"
      ANCHOR="lblField"
      CORNER="SW"
      DOWN=11
      WIDTH=50>
     <CONTROL
      NAME="txtRedirect"
      TYPE="TextBox"
      ANCHOR="lblRedirect"
      CORNER="NE"
      WIDTH=100>


    </CONTAINER>



   </CONTAINER>



  </CONTAINER>

 </EDITORLAYOUT>



 <ATTRIBUTES>
  <ATTRIB NAME="Field"  CONTROL="txtField">
  <ATTRIB NAME="Redirect" CONTROL="txtRedirect">
 </ATTRIBUTES>

 <TAGLAYOUT>
  <WIZIF OPTIONLowerCaseTags EQ 'true'>
   <WIZSET cfRelocate = 'cfRelocate'> --> ***When I use cf_Relocate here or
in other areas in the taglayout section, it gives me an error..***
   <WIZSET FIELD  = 'field'>
   <WIZSET REDIRECT = 'redirect'>
  <WIZELSE>
   <WIZSET cfRelocate = 'cfRelocate'>
   <WIZSET FIELD  = 'field'>
   <WIZSET REDIRECT = 'redirect'>
  </WIZIF>

     <WIZIF OPTIONLinearLayout EQ 'true'>
   <WIZSET SpacingGap =  ' ' >
  <WIZELSE>
   <WIZSET SpacingGap =  Chr(13) & Chr(10) & '       ' >
  </WIZIF>


<$${cfRelocate} $${Field}="$${txtField}"<WIZIF redirect NEQ ''
>$${SpacingGap}$${Redirect}="$${txtRedirect}"</WIZIF><WIZIF
TAGDATAUnknownAttributes NEQ
''>$${SpacingGap}$${TAGDATAUnknownAttributes}</WIZIF>>
 </TAGLAYOUT>
</TAG>

Thanks again,
Andy




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to