Search

I'm a novice user and after a long process of getting my site in working order (I had an ancient version of Symphony and updating to 2.3.3 took some sorting out), I can't get my images to render anywhere on my site.

They had been working fine before the update and there's no telling how much damage I did ignorantly rummaging through the files and trying to fix things myself. Here is what I'm getting:

An example of my site not rendering an image.

The XML for this page is here.

The XSLT is here.

get-photos.xsl

Hopefully, someone can help me figure it out.

This line is always false.

There is no /entry/@photos available.

I stopped here for this moment.

@juro Thanks! Sorry for my ignorance, but could you tell me how to fix that and/or what should be in its place?

@teoballve - do you have photos in your single article index datasource?

@bzerangue - No, looks like I don't: I'm not seeing a "photo" or "file" option in my single article datasource.

It would be in elements, right? And I don't see it.

It might be that you need to add a select box link from photos in your articles.

@ bzerangue: Hmmm... I might not of done it right but in the section I added a select box link aand highlighted "file," which is a value under "Photos." I then linked a photo to the article, but still nothing...

Be back in a bit.

Is that image related to the shown article? If yes, you need to create a relation as bzerangue pointed out. I asume that it is.

I added a select box link aand highlighted "file," which is a value under "Photos." I then linked a photo to the article..

I think you did it right this way. Now you have to add it to your Single Article datasource output as you did with fields like title and others.

And then you have to adjust the xsl template. I have to see your new XML output with the select box field added, but it might go like this:

You have to edit this part to:

<div class="left secondary">
    <xsl:apply-templates select="single-article/entry/photos" mode="photos"/>
<h3>more articles</h3>
...

adding also a new template:

<xsl:template match="*" mode="photos">
  <h3>photos</h3>
  <ul class="photo-list">
    <xsl:apply-templates select="item" mode="photo"/>
  </ul>
</xsl:template>

and your get-photos.xsl like:

<xsl:template match="item" mode="photo">
    <li><a href="{$root}/photo/{@id}"><img src="{$root}/image/1/240/0/{file/@path}/{file/filename}" alt="{title}" class="photo"/></a></li>
</xsl:template>

You'll probably have to adjust it a bit, also to fit your further needs.

[Original Comment Deleted - Maybe figured out the problem]

@Juro: Thanks! That definitely helped. But still not rendering. I think the problem lies in my get-photo.xsl:

<xsl:template match="item" mode="photo">
    <li><a href="{$root}/photo/{@id}"><img src="{$root}/image/1/240/0/{file/@path}/{file/filename}" alt="{title}" class="photo"/></a></li>
</xsl:template>

Here's why I think therein lies the problem:

1) When I click on the automated broken image icon—where the rendered image is supposed to be—it sends me to http://teoballve.com/photo instead of http://teoballve.com/photo/456/

2) When I right-click to open the icon where the rendered inmage is supposed to be it sends me to http://teoballve.com/image/1/240/0// (a 404 Error)

How do I write the correct paths for the get-photo.xsl? I think it will work if I get this part right.

P.s. I think the /image/1/240/0/ thing was used in my old (OLD) Symphony set up to re-size images.

I've tried lot's of different abstract paths that I've put together by looking for clues online as well as by looking (and trying to learn from) other working xsl files and still nothing. :(

Can you provide your XML for this?

Sure, sorry, should've posted it before:

Single Article: http://pastie.org/8326693

Photo Entry from which that Single Article should be pulling: http://pastie.org/8326698

Your XSLT is almost correct:

<xsl:template match="*" mode="photos">
  <h3>photos</h3>
  <ul class="photo-list">
    <xsl:apply-templates select="entry" mode="photo"/>
  </ul>
</xsl:template>

<xsl:template match="entry" mode="photo">
    <li><a href="{$root}/photo/{@id}"><img src="{$root}/image/1/240/0/{file/@path}/{file/filename}" alt="{title}" class="photo"/></a></li>
</xsl:template>

Notice entry in the select/match attribute instead of item.

Thanks @brendo but still nothing.

http://pastie.org/8327724#116-127

What should it be in the get-photos.xsl entry or item? In any case, I tried it both ways and still nothing.

@teobalive, we are getting nearer, but some things needs to be cleared:

You have an array of images - thats the Photos datasource and its output.

A) Are these images especially related to the Single Article?

or

B) Its just a general stock of photos you want to show on page?

Sorry if I don't get it from the comments above. But this is essential for the final XSLT.

Besides that, looking at your latest code, it looks like you have used Select Box field instead of Select Box Link field for your "Articles" section. These too are bit similar by their names, but do a bit different job. We proposed the second one to use.

Thanks.

Thanks @Juro: I'll change it back to Select Box Link. That's the way I had it for a while, but then experimenting with Select Box, it seemed like it was letting me choose actual files rather than links. I'll put it back to SBL.

As to your A or B question: All the photos I load onto the page will be because I want an article to have a photo associated with it. So the answer is A.

The way it worked before is that I'd load a photo and give it a parent article (i.e. a Single Article) and I'd also tick a box to indicate whether I wanted to include a teaser photo for the text excerpt that was being pulled onto the homepage and onto the articles index page.

If I can just get the photo to render with its associated article I think (hope) that I'll be able to figure out the rest.

Thanks, as always, for all your help people!

I wonder should I remove the SBL I have within Photos section that tries to link a photo to an article? (That's what I'm referring to as "parent" in my comment above.

Am I creating some sort of redundancy/conflict with that which is screwing things up?

I'll change it back to Select Box Link.

Could you also supply the current XML output?

Am I creating some sort of redundancy/conflict with that which is screwing things up?

No.

The way it worked before is that I'd load a photo and give it a parent article (i.e. a Single Article)

why don't you go the other way round? gaive an aricle a photo, not a photo an article, because you searching for articles, not for photos with description.

It would be much easier for you, if you not only export: angelayteo.jpg

in your singe alrticle handle. I'm exporting a lot of other usefull stuff to, like:

<image size="1.90 MB" path="/uploads/images" type="image/jpeg">
<filename>name.jpg</filename>
<meta creation="2013-09-04T20:39:35+02:00" width="1984" height="2740" />
<sample>
<item id="30" handle="metallic" section-handle="samples" section-name="samples">Metallic</item>
</sample>

so it's quite easy to get the picture realation (needed for javascript fitting) or the path or filename. yes, this means more work for the db, but I can live with that.

@juro Sorry, I keep forgetting to do that. Here's the XML.

About the SBL in Single Article vs Photo for linking the two. I'm trying to think about whether it makes more sense to create a photo before an article or an article before a photo. Seems like the latter makes more sense, but in whatever the case I should just focus on getting the photos to render before getting into that.

@moma I'll look into that.

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