Search

Has anyone ever altered a Datasource to include other datasources based on content in a field returned from the Database of a primary datasource?

I'm want to load images and files and possible widgets onto a page, based on the existence of a pattern found in a textarea.

This can be done in xslt using the ninja technique, but I was thinking of anyones loaded datasources based off of these patterns? Kind of like wordpress allows [gallery] tags in the content area. It would be a 2 step process with Symphony having to include the DS with potentially all galleries rather than pre=filtered DS based on tag such as `[gallery 2]' in a textarea. I know this isn't everyones cup of tea, but I'm looking for any pointers as to where I should start thinking about this.

Unless the above can be done using Chained Datasource somehow??

I haven't done anything of the like through content exactly.

What I did try once however was doing the check server-side, on saving an entry; if I found the variable I added it in another hidden field which is then output to allow chaining. thought it would be a better way to work as would reduce serverside loading and reading each DS output (i thought was less efficient)

So sort of a faux sbl to chain Id's using hidden fields. That does sound like a nice idea actually.. I prefer anything rather than messing with custom datasources tbh.

Were you using a custom extension to listen for these changes on save?

yep I think something of the sort; I've fixed the fieldid's within the the extension and got the data from DB if not mistaken it was a postEntryEdit/Create so its after the entry is actually saved.

Thanks for the tip @gunglien, I have a nice little extension that can preg_match for [image: {id}] in the textarea and datasource chain the images into the XML from this.

Woop :)

Next step, Drag and Drop media Gallery. #havingfun.

ow seems like a very nice idea... so far what I had used for images was something like inserting [1] in the content, replaced by a formatter to become <img src='1'/> and then a separate FileManagerField, with the order of images being matched up with the content. Nice idea for the drag and drop though :)

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