Search

To be clear - I'm fairly new to symphony.

After searching and trying a few extensions and methods of displaying images, I'm wondering if there's something I'm missing?

I'm finding it either too complex or too long winded to replicate a blog post like this : http://1013mm.com/blog/2012/10/2012-86fest-and-formula-drift-irwindale-final-round/

The first image method I found was this : http://www.rocketfoo.com/2010/07/31/building-a-site-with-symphony-cms-part-2/

Though after integrating a twitter feed, I'm curious if it's possible to integrate a Flickr Set (like the first link) but into a post. So each main post = a new flickr set, but without having to create a new data source per post?

Other complexities would be specifying which flickr image size is used too. I'm probably asking far too much of what's possible?

If anyone has any thoughts I'd really appreciate it. Cheers!

I've never used flickr but its possible to do. In your post just include the name of the flickr album, and use that to build your flickr feed to get the images. ( One datasource for all pages)

If you prefer to do this in Symphony; you could base this on the tutorial you've read but I would also use Sub-Section Manager. This would allow you to upload/link images directly into your article from a single page.

I've managed to partially get it working with the flickr feed. Though the image I need from each item in the feed is hard to select It's the second with no clear way to identify it (I'm looking into xPath more at the moment)

<link rel="alternate" type="text/html" href="http://www.flickr.com/photos/79955836@N08/8104320338/in/set-72157631809374162/"/>

<link rel="enclosure" type="image/jpeg" href="http://farm9.staticflickr.com/8475/8104320338_4b6c349317_b.jpg"/>

Currently, based on what I've learnt through the twitter example, I'm trying:

xsl:value-of select="atom:link/@href"

But this obviously selects the first one. Then even if I can select the 2nd image, I'm unsure how to restore it so it links to the flickr photo page again. I'm likely going about it in an awkward way, but it's all I have to go on based the twitter example.

Cheers for the suggestions. I've looked into Sub-Section Manager, there's not a lot of information on how to uses it but I'll probably use that for the initial thumbnail for each post. Flickr seems easier (if I can get it to integrate the sets) to show 20+ images?

I'm lost with how to use one datasource for multiple posts like you said though.

To select the second entry, you could try:

xsl:value-of select="atom:link[position() = 2]/@href"

Thanks a lot for that, it worked perfectly!

I quickly figured that you can't include it within img src="" which lead me to this, I don't know if it's the best way to do it, but it works:

<a><xsl:attribute name="href">
<xsl:value-of select="atom:link/@href"/>
</xsl:attribute>
<img><xsl:attribute name="src">
<xsl:value-of select="atom:link[position() = 2]/@href"/>
</xsl:attribute></img>
</a>

At the moment, I'm testing this 'floating' on a page, I'm not sure how easy or if it's possible to use the same code within a post. Currently with the way this all works - I'd have to use one datasource per blog post I think. Since the dynamic xml url is pointing specifically to the flickr album rather than all my photos. Is there slowdown/disadvantages to having to add new datasources indefinitely?

Your code is correct, although it can be shortened down to:

<a href="{atom:link/@href}">
    <img src="{atom:link[position() = 2]/@href}" />
</a>

The { ... } notation can only be used within attributes.

The same code can just as easy be included in a post, but I'd have to see your XML to see if it makes sense;)

You should be able to use one datasource for everything, I think, but I am not sure where the feeds are coming from at this moment...

Thanks again, much cleaner :)

It seems the oembed extension might be something that would make this a lot easier? Though it returns an error for me when used with flickr.

The flickr feed I'm using

It's a photo set/album within flickr - as opposed to all of my photos in one feed.

This is my current data source for the flickr feed http://i.imgur.com/HkSJa.jpg

So I think with my current setup, there would have to be far too many datasources to get it into a blog post? I can't quite get my head around it really, despite understanding the majority of the basics.

Hmm, I am not really sure what you are trying to achieve here. If you are planning on getting all these images in a post automatically (like in a sidebar or something), you'll only need the datasource you've setup right now.

You can then get the images from the feed one by one, and display them as you'd like.

In the post you've given the images are in the text itself, with text above and below it. This is usually done by simply adding the images to the text, rather than trying to do this automatically.

I hope this makes sense, and if I am completely rambling please share your wanted HTML with the XML you currently have using xpathr.

One way to solve the problem would be to expose the flickr api url in your section and make Symphony output it as an output parameter when fetching your entries, so that your datasource would look something like:

http://api.flickr.com/services/feeds/photoset.gne?{$ds-blog-post-flickr-url}&lang=en-us&format=atom_1

And when creating a new blog post you would simply insert in the Flickr URL field the correct set:

set=72157631809374162&nsid=79955836@N08

Makes sense?

Ah I see. I know what you mean - I'm just unsure on the specifics. Would the correct set be inserted into a text input field of the new blog post? I think something similar was used to display a single blog post in one of the main tutorials actually. I'll have a look and try it - thank you!

@creativedutchmen I realise the example I posted must be done manually to have the text in-between, though I plan to have some blog posts with just text at the top. Followed by a flickr set.

So I think, given alpacaaa's suggestion (If I'm understanding it correctly) The data source would contain the static url parts of the feed. Then in each post - there would be a section that I can enter in the set=ID, that would be 'injected' into the data source url - and each post could display a different flickr set.

So it should be possible, I'm just struggling to do the specifics haha. This is how I currently have it working, on a separate page from the actual blog. http://pastebin.com/8TDQJcsp

I hope this helps in explaining what I'm trying to do? At the moment I'm trying to work out how to 'inject' that set ID to the data source url. & How to display it within a post, or if it would be in a utility.

@Nismo, that is certainly possible.

The way this would work is the following: you have a page with a parameter post-name (or similar) set. This parameter is used in a datasource to get only the blog entry you want to display (the GTI Festival, say), we'll get to that in a minute.

In your blog section, you have a field (which can just be a standard text-field) called flickr id where you set the changing part of the flickr feed (the bit @alpacaaa mentioned). So, if you create the GTI Festival blog entry, you would write some text, and set that flickr id to set=72157631809374162&nsid=79955836@N08.

Then you create a datasource which grabs the entries from blog, and has a filter on the post name with the value $post-name which is passed from the page. In this datasource, you output the flickr-id as a parameter (look at the bottom of the editor for this). Then you attach the datasource to your page.

What happens now if you visit the page is the following: the page will set the $post-name parameter with the value in the url (blog/this value). The blog post with that name is then fetched, and its flickr id is put into the parameter pool as $datasourcename.flickr-id.

We are now 90% there. If you modify your flickr feed datasource to use the $datasource.flickr-id as its dynamic part, it will put that bit in the url before fetching it. This means you will now only grab the flickr feed you wanted to.

Now we need to do something with that data, for this, google for xslt apply-templates, and be sure to look at the ?debug page when things aren't working the way you want:)

Hope this helps!

It took 3-4 attempts but I got there in the end. I re-did this tutorial which helped in understanding your post better:

Step 4. Create an Individual Entry View

I suspect it failed the first few times because I was reading your post - forgetting I already had some of the elements in place, or assuming I had.

Thanks a lot for your patience & to alpacaaa for his help. I now have two blog posts showing different flickr data on single entry view.

Now I just have to do something with that data haha. I think it should be similar to the coding I was using before? though that can't be pasted directly into the existing blog-post template. I'll have to learn some more to do with apply-templates like you said :)

Edit - The flickr feed also has thumbnail sized images, should be handy Flickr Feed Thumbnail Example

Yep, it takes some time before you really "get it". Glad you got it working though!

One thing I would definitely look at if I were you is Just In Time Image Manipulation. It's an extension that is bundled by the core that can do the resizing of the images you want. You can set your own sizes rather flexibly - pretty awesome.

Thanks, I'll take a look at it. I think the flickr integration was the part I was expecting to be most difficult so hopefully I can figure out the other elements of the site on my own.

Currently I've inserted the flickr template 'after' the blog post rather than inside it, but it looks part of it since it's viewed as a single blog post. I couldn't see any other obvious ways of doing this but I'll do some more googling haha.

Current 'Single Blog Post' Layout

Flickr should make mass image posts very easy though, I'm wondering what the downfalls are other than specific control of text wrapping images - since nobody else seems to be doing it.

I figured if I wanted a text/caption below each image I could do it in the flickr description. I'm struggling to select the description with xpath at the moment, but I suppose xpath gets easier the more you try to solve this stuff.

I'm wondering what the downfalls are other than specific control of text wrapping images - since nobody else seems to be doing it.

Well, parsing XML from a feed and displaying it again is something we all do, I think...

Once you work with Symphony for a while this will all feel like the same thing: twitter, flickr, agenda feeds, competition schedules, last.fm; when they offer XML or JSON you'll know you can parse it and display it exactly how you want, without needing to customise plugins, hack yourself through piles of crappy php or that kind of stuff.

It will spoil you ;)

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