Search

why don't you go the other way round?

Because that's not how associations are designed to work in Symphony. The child (Image) should always be linked to the parent (Article) by an SBL or a derivative thereof.

@teobalive, I see no reference to the parent article in your photos/entry nodes in that XML, have you output the field in the datasource editor?

PS, is this all related to the issue you had with the upgrade and the Section Link Field?

If so, you have more than likely not got a SBL field to link the images to the articles, and as the Section Link field no longer works, the links from that field are gone.

This may be a problem.

sorry I missunderstood that, of course is an image linked to an article. my english just seems to pure to post something. In another way an xml like I posted could be renderd.

THX desingermonkey to make this clear.

@designermonkey as to your second point about the upgrade. I honestly don't know.

About the first point do you see it now? http://pastie.org/8328188

I think I'm a bit confused about DS output parameters/fields vs XML Output elements.

Last thing should the get-photos.xsl in utilities be matching item or entry? I've tried both and nothing, but just want to make sure that it's right:

<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>

Is this of interest from that XML I just posted?: http://pastie.org/8328188#216-218

on the default workspace there is an datasource articleImages. I miss something like that.

Please post your full XSLT and XML. Without the whole picture its very hard to help :)

Based off what I've seen of your XML, it should be entry but this may change depending on the context of where you are using the template, hence needing the full file :)

Sorry, and thanks for letting me know @brendo. Here it is:

Single article page (which should be rendering the photo): http://pastie.org/8328922

Single photo page (the photo that article should be associated with): http://pastie.org/8328929

Get-photos utility: http://pastie.org/8328931

XML from an example of article not rendering photo: http://pastie.org/8328934

Sorry if this is TMI, but there you have it.

Ok, lets do this!

Your single-article DS is returning the output of the Select Box Link field:

        <photos>
            <item id="456" handle="angelayteojpg" section-handle="photos" section-name="Photos">&lt;a href=&quot;http://teoballve.com/workspace/uploads/angelayteo.jpg&quot; data-path=&quot;/workspace/uploads&quot;&gt;angelayteo.jpg&lt;/a&gt;</item>
        </photos>

You are calling this like:

<xsl:apply-templates select="single-article/entry/photos" mode="photos"/>

When then hits up these two templates:

<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>

The problem here is entry. It should be:

<xsl:apply-templates select="item" mode="photo"/>

The resulting template should then match on item:

<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>

Now lets have a look at our XML again:

        <photos>
            <item id="456" handle="angelayteojpg" section-handle="photos" section-name="Photos">&lt;a href=&quot;http://teoballve.com/workspace/uploads/angelayteo.jpg&quot; data-path=&quot;/workspace/uploads&quot;&gt;angelayteo.jpg&lt;/a&gt;</item>
        </photos>

Note there is no file node here? What we need to do reference the other datasource you have in your XML with this information, which looks to be photos. This might result in a template like:

<xsl:template match="item" mode="photo">
<xsl:variable name='photo' select='/data/photos/entry[@id = current()/@id]' />

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

What is this template doing?

  • It's creating a reference to the photos datasource in the variable $photo. This is cross referencing by the photo ID.
  • $photo has the context of /data/photos/entry[@id = 460]. The result of the template has the context of /data/single-article/photos/item. So if you want to reference something the photos datasource, you need to use $photo. Otherwise, omit it to access your current context.

Hope that helps!

I'm running out the door, but ta-daaaaaa: http://teoballve.com/article/test-for-image-render/ That did it!

Thanks everyone, and especially @brendo for helping me and taking the time to spell it out for me. I'm SLOW, but I'm learning.

Thanks again!

Good work teobalive!

Good work.

It tried to send you a note via contact form, but didn't work. dont know why: allways said:

The system encountered errors while sending your email. Please check if all the required fields have been filled.

but I filled in:-(

and when you are paranoid about loginnames, read this one

http://www.getsymphony.com/discuss/thread/103147/

Thanks @moma I'll get to that ASAP.

You guys are going to kill me--and please let me know if yet another cry for help is beyond the bounds of acceptable forum assistance. The last thing I need for my photos to be working as they had been before the upgrade are my teaser images.

In other words, I used to have each Single Article's photo rendered as a teaser image 1) when the article was excerpted on the homepage and 2) when you saw the excerpt on the articles index page.

I thought I'd be able to figure it out by adapting Brendo's instructions above, but I haven't been able to get it to work.

Homepage XML

Homepage XSLT

Articles Index XML

Articles Index XSLT

I'm posting both sets, but really I'm pretty sure I'm making the same mistake in both sets, so resolving one should let me fix both. Once I resolve this I'm sure it will be a while before I'm back at the forum with any problems (famous last words, I know...;)

I sent an email to @teoballve. He had some legacy code from the old Symphony 2.0.x days in his templates.

Sadly, I'm back.

Photos from my Multimedia section are not rendering on my homepage. Here's the XML:

http://pastie.org/8360939

Homepage XSLT: http://pastie.org/8360958

Also, photos are also not rendering on the single-entry pages of my other section. The XML (for example):

http://pastie.org/8360948

Single entry XSLT: http://pastie.org/8360965

I've been trying to fix this for a few days now, and I can't figure it out.

Basically, multimedia photos render on single entries, but not on homepage; while my other section renders photos on homepage, but not on single entries. But all sections render photos on their index pages. (Sounds like an S.A.T question.)

Any help out there?

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