Developer forum

Forum » Templates » Datalist list-template problem

Datalist list-template problem


Reply
The list.html template in the datalist-module shows a row.value tag. This means that I cannot edit each collumn for itself. I have tried inserting dwtemplatetags, but this didn't give me anything usefull.

The problem I am facing, is that I want to show or link to the pictures that I upload via the forms-module. Right now, it simply shows the relative path to the picture, and I want to be able to insert <img src=http://solution.net.dynamicweb.dk[CollumnValue] /> or something simular.

Is this only possible through xslt?

My XSLT is far from good enough to be able to create this kind of template, so I hope this can be done with the html-template, somehow.

Replies

 
Reply
What if you used the Row.Value filed like this:

<img src="<!--@Row.Value-->" border="0" />
 
Reply
Yeah, but wouldn't that only work, if I had only the one collumn to display, which certainly is an option, but still not optimal.

If you have other collumns, like Name, Email and Title for instance, the output from these will also be included in the image-tag and will then result in a broken image.
 
Reply

It is possible with XSLT. If the path to the file always is the same then it can be done like this:
 <xsl:choose>
                        <xsl:when test="starts-with(Row.Value, '/Files/Filer')">
                              <td><a href="http://www.domainname.dk/{Row.Value}"><xsl:apply-templates select="Row.Value" /></a> </td>
                       
                        </xsl:when>
                        <xsl:otherwise>
                              <td><xsl:apply-templates select="Row.Value" /></td>
                       </xsl:otherwise>

                                  
             </xsl:choose>

 
Reply
Hi Guys

Yes, with XSLT everything, almost, is possible.
But in Lars' case he doesn't really have this option. 

Unfortunately it is not possible to do when using HTML since the loop is containing multiple fieldtypes.

// Dammark
 
Reply

Thanks for your response anyway.

It seems that I will need to learn some XSLT :) In any case, I can use your help and examples - also from the Photoblog-guides - to get some practice.

 

You must be logged in to post in the forum