[opencms-dev] Link Management for Form Actions

Steve Bryan steve at bright-interactive.com
Fri Apr 23 11:23:39 CEST 2010


Hi all

I wonder if anyone can answer this question about OpenCms internal link
management? I noticed that the management kicks in for hyperlinks in xmlpage
content, but not for form actions. This is quite an unusual situation I
guess but we do have a form in our content so we can have a button rather
than a link.

EG source code of content element:
<h3>YOUR NEXT STEP</h3>
<p><a title="Send an enquiry"
href="/dtw/opencms/en/contact/make-enquiry/form.html">Send us an enquiry
»</a></p>
<form style="display: inline" method="get"
action="/dtw/opencms/en/contact/make-enquiry/form.html">
    <input type="submit" value="Make an Enquiry" />
</form>



OpenCms does it's magic and saves it with this control code:
<?xml version="1.0" encoding="UTF-8"?>

<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.opencms.org/dtd/6.0/xmlpage.xsd">
  <page language="en">
    <element name="body">
      <links>
        <link name="link0" internal="true" type="A">
 
<target><![CDATA[/sites/dtw/en/contact/make-enquiry/form.html]]></target>
          <uuid>34f25d82-ba7d-11dd-912e-9ff002f2dde6</uuid>
        </link>
      </links>
      <content><![CDATA[<h3>YOUR NEXT STEP</h3>
<p><a title="Send an enquiry" href="%(link0)">Send us an enquiry
»</a></p>
<form style="display: inline" method="get"
action="/dtw/opencms/en/contact/make-enquiry/form.html">
    <input type="submit" value="Make an Enquiry" />
</form>]]></content>
    </element>
  </page>
</pages>


Notice that the a href attribute is converted to an internal link but not
the form action. Is there any way to achieve this? I would be grateful for
ideas - it is a problem for us since we strip the tomcat context and opencms
on live.

Thanks
Steve 





More information about the opencms-dev mailing list