Multiple list item returns from Blog through Content Query Web Part
-
28 iunie 2012 14:08
I followed Erik Swensons Blogpost to create a customized content query web part. So far I have customized with graphics and got this result:
<xsl:template name="Activities" match="Row[@Style='Activities']" mode="itemstyle"> <xsl:variable name="SafeLinkUrl"> <xsl:call-template name="OuterTemplate.GetSafeLink"> <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/> </xsl:call-template> </xsl:variable> <xsl:variable name="DisplayTitle"> <xsl:call-template name="OuterTemplate.GetTitle"> <xsl:with-param name="Title" select="@Title"/> <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/> </xsl:call-template> </xsl:variable> <xsl:variable name="StartDate"> <xsl:value-of select="ddwrt:FormatDateTime(string(@PublishedDate), 1033, 'g')" /> </xsl:variable> <table class="activitiestable" border="0" cellpadding="0" cellspacing="0"> <tr> <td class="header" colspan="8"> </td> <td class="spacer10"> </td> </tr> <tr> <td class="activities2" colspan="2" rowspan="2"> </td> <td class="activities3" colspan="2"> </td> <td class="activities4"> </td> <td class="charity" colspan="3" rowspan="3"> </td> <td class="spacer11"> </td> </tr> <tr> <td class="activities6"> </td> <td class="activities7" colspan="2" rowspan="4"> </td> <td class="spacer12"> </td> </tr> <tr> <td class="activities8" rowspan="4"> </td> <td class="activitiestext" colspan="2" rowspan="3"> <xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/> <a href="{$SafeLinkUrl}" title="{@LinkToolTip}"> <xsl:if test="$ItemsHaveStreams = 'True'"> <xsl:attribute name="onclick"> <xsl:value-of select="@OnClickForWebRendering"/> </xsl:attribute> </xsl:if> <xsl:if test="$ItemsHaveStreams != 'True' and @OpenInNewWindow = 'True'"> <xsl:attribute name="onclick"> <xsl:value-of disable-output-escaping="yes" select="$OnClickTargetAttribute"/> </xsl:attribute> </xsl:if> <xsl:value-of disable-output-escaping="yes" select="substring($DisplayTitle, 1, 40 +string-length(substring-before(substring($DisplayTitle, 41),' ')))" /> </a><br /> Posted on <xsl:value-of select="$StartDate" /> </td> <td class="spacer13"> </td> </tr> <tr> <td class="activities10" colspan="3"> </td> <td class="spacer14"> </td> </tr> <tr> <td class="activities11"> </td> <td class="twitterfeedtext"> </td> <td class="activities13"> </td> <td class="spacer15"> </td> </tr> <tr> <td class="activities14" colspan="3"> </td> <td class="activities15"> </td> <td class="activities16" colspan="3"> </td> <td class="spacer16"> </td> </tr> <tr> <td class="spacer17"> </td> <td class="spacer18"> </td> <td class="spacer19"> </td> <td class="spacer20"> </td> <td class="spacer21"> </td> <td class="spacer22"> </td> <td class="spacer23"> </td> <td class="spacer24"> </td> </tr> </table> </xsl:template>I have not changed any other files besides what the above guide directed me to in order to display custom items.
My problem:
With the query, when I list, lets say 5, items I get 5 of those tables. Well I don't want 5 of those tables. I want 5 items to be displayed in the below table:
<td class="activitiestext" colspan="2" rowspan="3"> <xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/> <a href="{$SafeLinkUrl}" title="{@LinkToolTip}"> <xsl:if test="$ItemsHaveStreams = 'True'"> <xsl:attribute name="onclick"> <xsl:value-of select="@OnClickForWebRendering"/> </xsl:attribute> </xsl:if> <xsl:if test="$ItemsHaveStreams != 'True' and @OpenInNewWindow = 'True'"> <xsl:attribute name="onclick"> <xsl:value-of disable-output-escaping="yes" select="$OnClickTargetAttribute"/> </xsl:attribute> </xsl:if> <xsl:value-of disable-output-escaping="yes" select="substring($DisplayTitle, 1, 40 +string-length(substring-before(substring($DisplayTitle, 41),' ')))" /> </a><br /> Posted on <xsl:value-of select="$StartDate" /> </td>
Granted I know that I would have to insert multiple lines in their for each item I want displayed. So how would I instead of selecting only the latest item in that list grab the latest 5 or 6 items in that list? Here is a picture and basically I want to list those 5 or 6 or however many items within the white space provided..
- Editat de James Coffman 28 iunie 2012 14:12 content removal
Toate mesajele
-
2 iulie 2012 02:38Moderator
-
11 iulie 2012 00:03If you are still having issues with this and you cannot find an answer from the forum directly, please visit the link below to see the various paid support options available that may better meet your needs.
http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone