Search

Hi Everybody

I’m trying to build a blogpost/comment page.

The blogposts work perfectly. And so does my event for saving the comments.

When saving the comment I have a hidden field on my event where I save the handle for the current blogpost. This is how I bind my comments to a specific blogpost. Like this:

Is this the right way to bind blogposts and comments together ?

When creating my data source(comments-by-blogpost), I would like to filter it so that the output only contains the comments for the current blog-post I’m standing on in my browser. But I cant get it to work, what am I doing wrong. Look at the attached screendump and XML dump.

If I’m on this blogpost: http://symphony.dammark.net/home/post/xslt-ftw I would expect my XML to only have 3 comments, but for some reason it has 5 (all) comments. And I think this could get very load heavy by time.

What am I doing wrong ?

Regards Sebastian

You should be using a Select Box Link Field in your Comments section to join the two. The field takes the ID of the related entry, so your hidden input would contain the blog entry’s ID rather than its handle. This is more fool-proof.

Then, have your blog post data source output its system ID, and filter your comments data source by that. It’s called data source chaining.

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