Search

So this is kind of hum-dinger….

I have my Flickr Feed coming in from the flickr API

http://api.flickr.com/services/rest/?&method=flickr.photosets.getPhotos&api_key=somethinghere&photoset_id={$ds-flickr-set-number}&fotmat=rss_200

The ($ds-flickr-set-number} is from a DS where the user inputs the Flickr Set Number they’ve created.

I’m hoping that I can generate results from multiple entries when there are multiple photo sets e.g. January Photos, February Photos, etc.

However the feed only runs once and I can’t seem to run an IF statement since the feed only wants to run once.

Is there a way I can change the $ds-flickr-set-number param relative to the page?

@PMADesign -

Could you post your XSLT and your XML on pastie.org? also, would you mind including parameters that are showing?

Are you pulling that Flickr Feed as Dynamic XML in your datasource. And you’ve attached that Dynamic XML data source to your page?

I think I understand this. So when you have one entry on a page is provides its $ds-flickr-set-number parameter. But when you have multiple entries, these Flickr set numbers are concatenated into that parameter. For example four entries might yield:

$ds-flickr-set-number 1,2,3,4

The problem is that the Dynamic DS runs once and will take all of these values to build the URL:

http://api.flickr.com/services/rest/?&method=flickr.photosets.getPhotos&api_key=somethinghere&photoset_id=1,2,3,4&fotmat=rss_200

And you want the Dynamic DS to run once per entry (i.e. four times).

As far as I know, this cannot be done in the core. You might need an intermediary PHP script to do this for you. If you were to set your Dynamic DS to point to:

{$root}/get-flickr-stuff.php?sets={$ds-flickr-set-number}

Within get-flickr-stuff.php you would need to:

  • split $_GET['sets'] by commas, loop over each number
  • make a request to the Flickr URL to get the XML yourself: simplexml_load_file('http://api.flickr.com/services/rest/?&method=flickr.photosets.getPhotos&api_key=somethinghere&photoset_id='.$set.'&format=rss_200')
  • append the results of each to a root element, also appending the set number to the XML, so it can be cross-referenced in the XML

Shame it can’t be done in the core…

Thanks Nick, this is EXACTLY my problem!

The problem is I have little-to-no experience PHP skills.

One possible improvement to allow this kind of thing to happen in the core is to add filtering to pages themselves. Maybe?

I’m pretty sure I could pull off most of this in Javascript, but I was hoping to avoid that.

Would your XML Pool extension be a way of solving this problem? Defining the param in the page itself?

Has anyone a working solution for this problem and wouldn't mind to share it?

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