I'm still trying to solve this, I had an idea if I could make a content folder then have a few folders then just select the bottom folder by ID and bring that content in, and call it "Latest" for the client to understand?
Yeah your first idea, i need the client to be able to create comments (that will be displayed on the homepage) almost like a recent testimonials if you like, but only the last one the client puts into the backend will be shown.
I hope that clears it up, thanks for your replies chriztian, very helpful!
Create a content folder for storing them and the actual Testimonial/Comment type - in XSLT you can do something like this to extract the latest automatically:
<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:umb="urn:umbraco.library"
exclude-result-prefixes="umb"
>
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes" />
<xsl:param name="currentPage" />
<xsl:variable name="siteRoot" select="$currentPage/ancestor-or-self::*[@level = 1]" />
<!-- Select all the testimonial docs (use your actual doctype aliases here) --> <xsl:variable name="testimonials" select="$siteRoot/Testimonials//Testimonial" />
<!-- To display the latest, we need to sort them backwards and take the 1st -->
<xsl:template match="/">
<xsl:for-each select="$testimonials">
<xsl:sort select="@createDate" data-type="text" order="descending" />
<xsl:if test="position() = 1">
<xsl:apply-templates select="." />
</xsl:if>
</xsl:for-each>
</xsl:template>
<!-- Template for the one to show -->
<xsl:template match="Testimonial">
<blockquote class="testimonial">
<xsl:value-of select="bodyText" />
</blockquote>
</xsl:template>
</xsl:stylesheet>
Recent comments box
Hi there!
I am trying to figure out how I would have a recent comments box and then grab some content into the template.
I'm not sure if this will be a macro or xslt script, but this is what I need it to do;
Client writes up some content > Then the most recent bit of content written by the client needs to be displayed in the template.
I'm kind of stuck how to achieve this, can anyone point me in the right direction?
Thank you!
I'm still trying to solve this, I had an idea if I could make a content folder then have a few folders then just select the bottom folder by ID and bring that content in, and call it "Latest" for the client to understand?
Hi Nick,
I'm really not sure I understand this — do you need to grab whichever content that was last updated/created and show that somewhere on the website?
Or is this only in the Backoffice?
/Chriztian
Yeah your first idea, i need the client to be able to create comments (that will be displayed on the homepage) almost like a recent testimonials if you like, but only the last one the client puts into the backend will be shown.
I hope that clears it up, thanks for your replies chriztian, very helpful!
Cheers
OK, great - here's a recipe:
Create a content folder for storing them and the actual Testimonial/Comment type - in XSLT you can do something like this to extract the latest automatically:
/Chriztian
Thank you!
is working on a reply...