Hi all,

I'm looking for some help in getting a list of entries from a section that are not associated with any entries in another section. The setup is as follows:

The first section has a 'reference link' field, pointing to a second section. (I assume the logic would be the same for a SBL field). The DS for the second section will give a count of related documents in an attribute, e.g.

<entry id="22" section1="1">

I want to get a list of all entries with section1="0". At the moment I have all section2 entries in the DS, and the XSLT checks for this, but this is obviously pretty unwise as the section grows.

Is there an easy way to do this at the DS level? If a custom DS is needed, could anybody point me to how to create it?

Thanks for your help.

We did a lot of work recently with associations, and the biggest part of it was gaining an understanding from a UI point of view was to have the link between sections in the child section...

You can then have your DS find child entries that aren't linked to a parent by using sql: NULL in the filter box for that field.

Please bear in mind that this is broken in the integration branches.

Just to clarify, Section 1 would be something like Categories, and Section 2 would be something like Products.

Products would contain the link to Categories, and a DS called Products without Categories could be created, and the SBL can be filtered with sql: NULL.

Ignore me about it not working, it's working perfectly.

So, yes, my above is the way to achieve what you're after.

Thanks for your help designermonkey. My setup is similar to what you describe, with the reference link on the child section. Is there any easy way to get a list of categories with no products, though? This is where I'm guessing a custom DS is needed, or is there an alternative?

More generally, I get the logic of the parent-child setup, but I wonder how best to address sections that are closer to siblings? (I see there was a bi-link field extension that seems like it suited this case).

Anyway, I expect my section setup could have been rethought, but this is an active site with a lot of content, so I'll have to live with what I've got :)

That's where a DS from the Categories section would need a count of entries in a related section. That's the only core way of doing it without customisation.

That's what I thought. I have it set up like that at the moment, but I'd rather not be outputting all entries in a DS for the sake of a few (at the moment it's only 1, in fact).

Any suggestions for customising the DS to filter based on the child section count? This is where my limited SQL and PHP skills fail me...

I have a suspicion that DS chaining is required here...

When I get a moment, I will have a look.

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