Search

Hi there,

Based in this post: http://symphony21.com/forum/discussions/96/1/ I have linked a section to another section with a select box and Dynamic Options as a alternative for having multiple uploads in one entry, and it works.

What I can't get right however is getting the image path in the XML data somehow. No matter how I play with the datasources configuration I can't see how I can set the image path to appear in the XML, which I need to display them off course. The only thing that appears are the images title and handle.

Is there a way to do this?

Because your original data source is just pulling in your "parent" entries (the ones your images are attached to). For each entry in the parent, it will display a node representing a link to the "child" (image). Therefore you will need a second DS to retrieve these images, since a DS can query only one Section as a time.

To do this you will want to use Output Parameters. Go to edit your existing DS, and on the bottom left is an option to add an output parameter. Select the field that is the section link to your images section from this list. This means that when the DS executes, it will create a parameter named $ds- followed by the DS name. You can verify this by seeing it in the Params list when you ?debug a page.

So let's say your DS is called "Blog Posts". When the output param is set and the DS attached to a page, there should be a param named $ds-blog-posts outputting a list of all of the entry IDs of associated Image entries.

So you then need to create your second DS to query the Images/Uploads section. Create a simple DS and filter the System ID field by this new parameter $ds-xyz.... When attached to your page the first DS will output a list of the IDS of linked Uploads, and the second DS will take this list and provide the filtered entries.

Using XPath you can link the two together, based on matching entry ID attributes.

Hope that made sense!

Thanks nickdunn, that actually works!

Although I am now only getting the filtered images from the last entry in the 'calling' datasource, not a summary of all images tied to all entries.

Is that right?

The thing I am tryinh to achieve is getting a list of news items with a thumb showing the first coupled image of the linked upload section.

I got it almost working, except one thing.

In the orginal datasource I have selected 'Image' in the Output options. In the debug Params list I can now see the list of all images titles tied to the original datasource.

In the images datasource I have added the $ds-.... param to the Title value, using the System ID produced 'no records found'.

Having done this the images are indeed filtered based upon the coupled entries in the original datasource, but not al images show up..

It seems a bit random. It will take the first listed image in original ds entries, but will ignore that entry if there are more then one images coupled?

It seems that once an entry in the original data source has multiple entries from another datasource tied to it the filtering with the second datasources 'Filter Results' param is skipped for that entry.

Can that be right?

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