we would like to edit records on the frontend, and use the Form controls: But how can we put the database values in the textboxes?

<xsl:call-template name="form:input">
    <xsl:with-param name="handle" select="'title'"/>
    <xsl:with-param name="value" select="'My first blog post'"/> </xsl:call-template>

You need to use a data source to fetch the entry, and the “select” attribute for the “value” parameter would be an XPath query to to text value in the XML.


That’s exactly what we are doing, but then: - New record is created - Values entered are ignored + old values are inserted

How can we pass the ID, so it’s an update, not a create? Thanks for your feedback.

Have you included the hidden field with the entry ID in your form (as mentioned in the “save comment” event’s documentation)?

<input name="id" type="hidden" value="23" />

Michael is correct. Form Controls doesn’t add this for you, you need to add the ID hidden input to the form.

Thx for the fast replies, with the hidden ID field, my record is now not created again, so almost there, but Values entered are ignored + old values are inserted

Can you post the XML and XSLT you’re using?

OK, editing a normal field word works. But with multilingual field, it writes only the first letter to the both fields. How can i pass the value-en field?

<label> Title<br/>
          <xsl:call-template name="form:input">
            <xsl:with-param name="handle" select="'title'"/>
            <xsl:with-param name="value" select="/data/dstypes/entry[@id  = '92']/title"/>
            <xsl:with-param name="text" select="'title'"/>

Anyone knows how to pass the value to the title language field (value-en) with form controls?

Firstly, how would you achieve this without Form Controls, just with normal HTML?


THX, Like in the backend code:

<input name="fields[title][value-en]" type="text" value="Cable" class="size-single" length="0">

Hmm in which case this won’t work with Form Controls — it has no concept of the second array key [value-en] and so won’t look for this when trying to re-populate the input value on postback. It’d be quite a fiddly job to get this working (feel free to delve into Form Controls if you dare…!) so you might be better off building your form as “normal” HTML/XSLT.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details