Search

Using the default Symphony theme, I created an event that would create “Note” entries. The HTML form it generated is straightforward:

<form method="post" action="" enctype="multipart/form-data">
  <input name="MAX_FILE_SIZE" type="hidden" value="5242880" />
  <label>Date
    <input name="fields[date]" type="text" />
  </label>
  <label>Note
    <textarea name="fields[note]" rows="15" cols="50"></textarea>
  </label>
  <input name="action[note]" type="submit" value="Submit" />
</form>

However, when I add that code to the home.xsl template and try to submit data, nothing happens (no error, no content added). As described in the docs, there should be some information returned no matter what, something following this format:

<note result="error">
  <message>Entry encountered errors when saving.</message>
  <field-name type="invalid | missing" />
  ...
</note> 

I don’t know how to inspect the debug information after a POST request, but I tried to access the note’s “message” tag in a number of ways, without success:

<xsl:value-of select="message" />
<xsl:value-of select="/note/message" />
<xsl:value-of select="note/message" />
<xsl:value-of select="note/*" />
<xsl:value-of select="/events/note/message" />
<xsl:value-of select="events/note/message" />

<xsl:for-each select="events/note">
    <xsl:value-of select="message" />
</xsl:for-each>

The “add a comment” event that came with the theme works just fine. Not sure where I’m going wrong.

Did you add the event to the page? If you go to the page editor, you’ll see a multiselect where you can choose which events are attached to that particular page.

No. Duh. Knew it had to be a dumb mistake, thanks. (I was working through the excellent tutorial from bauhouse which mentioned attaching events to pages)

@matth:

I don’t know how to inspect the debug information after a POST request

For debugging you can add ?debug to the “action” attribute of your form. This willl take you right to the debug page.

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