Search

I am making some headway (mentally) with understanding symphony in terms of constructing a page from data sources transforming XML into HTML etc.

Unfortunately I am rather confused as to how, for example, saving a comment works via events. When I look at the event code in, say, event.save_comment.php in the default example site, it doesn’t give me much clue as to how the posted form data is getting saved into a DB or how.

I appreciate this may have been asked before so I appreciate the patience of the more experienced members here. I suspect that for me and many others, getting past the starting block is tricky but once the lightbulb moment happens, we progress at some pace!!

Cheers,

Rob

The beauty is that you don’t need to understand exactly how it’s persisted back to the database. Take a look at an event by going Blueprints > Events > (click on event). It should show you an example HTML form. Copy and paste this into a page to get you started.

The basics:

  • fields are posted using HTML form elements, their name attributes match the “handle-ised” name of your fields (the same as what appears in your DS XML) e.g. fields[title] or fields[content].
  • also include a field with the name id. If this is present then the entry with an ID matching the value attribute of the form element will be updated. If the id field is absent in the POST, a new entry is created
  • if you want to update/insert more than one entry at a time (in the same section) you can enable the “Allow Multiple” option in the event. Check the example HTML markup to see the new syntax for naming form fields

Thanks Nick.

I suppose in many ways it’s good for it to work “out of the box” as it were, but as a developer I’d much rather know the underlying workings. I’ll delve into the code over time and understand more no doubt, this is the joy of open source.

Enjoying the process so far, and that isn’t the norm with trying a new CMS in my experience!!

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