Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="utf-8"?>
- <!DOCTYPE xsl:stylesheet [
- <!ENTITY nbsp " ">
- ]>
- <xsl:stylesheet
- version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:msxml="urn:schemas-microsoft-com:xslt"
- xmlns:umbraco.library="urn:umbraco.library"
- exclude-result-prefixes="msxml umbraco.library">
- <xsl:output method="xml" omit-xml-declaration="yes" />
- <xsl:include href="_pagination.xslt"/>
- <xsl:param name="currentPage"/>
- <xsl:variable name="page" select="umbraco.library:RequestQueryString('page')" />
- <xsl:template match="/">
- <xsl:variable name="matchedNodes" select="$currentPage/descendant::*[@isDoc]" />
- <xsl:variable name="nodeCount" select="count($matchedNodes)" />
- <xsl:if test="$nodeCount > 0">
- <xsl:variable name="page">
- <xsl:choose>
- <!-- first page -->
- <xsl:when test="number(umbraco.library:RequestQueryString('page')) <= 1 or string(umbraco.library:RequestQueryString('page')) = '' or string(number(umbraco.library:RequestQueryString('page'))) = 'NaN'">
- <xsl:value-of select="number('1')" />
- </xsl:when>
- <!-- last page -->
- <xsl:when test="number(umbraco.library:RequestQueryString('page')) > $nodeCount div $resultsPerPage">
- <xsl:value-of select="ceiling($nodeCount div $resultsPerPage)" />
- </xsl:when>
- <!-- the value specified in the url -->
- <xsl:otherwise>
- <xsl:value-of select="number(umbraco.library:RequestQueryString('page'))"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="startMatch" select="($page - 1) * $resultsPerPage + 1" />
- <xsl:variable name="endMatch">
- <xsl:choose>
- <!-- all the rest (on the last page) -->
- <xsl:when test="($page * $resultsPerPage) > $nodeCount">
- <xsl:value-of select="$nodeCount" />
- </xsl:when>
- <!-- only the appropriate number for this page -->
- <xsl:otherwise>
- <xsl:value-of select="$page * $resultsPerPage" />
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="$matchedNodes">
- <xsl:apply-templates select="$matchedNodes">
- <xsl:sort select="@createDate" order="descending" data-type="text" />
- <xsl:with-param name="startMatch" select="$startMatch" />
- <xsl:with-param name="endMatch" select="$endMatch" />
- </xsl:apply-templates>
- </xsl:if>
- <xsl:if test="$nodeCount > $resultsPerPage">
- <xsl:call-template name="pagination">
- <xsl:with-param name="page" select="$page" />
- <xsl:with-param name="matchedNodes" select="$matchedNodes" />
- </xsl:call-template>
- </xsl:if>
- </xsl:if>
- </xsl:template>
- <xsl:template match="*[@isDoc]">
- <xsl:param name="startMatch" />
- <xsl:param name="endMatch" />
- <xsl:if test="position() >= $startMatch and position() <= $endMatch">
- <br/><br/>
- <div id="main-wrapper">
- <div id="main" class="container">
- <div class="row">
- <div class="12u skel-cell-mainContent">
- <div class="content" style="margin-left:130px">
- <!-- Content -->
- <article class="is-page-content">
- <h3>
- <a href="{umbraco.library:NiceUrl(@id)}" style="text-decoration:none;color:#64AFD4;">
- <xsl:value-of select="@nodeName" />
- </a>
- </h3>
- <xsl:choose>
- <xsl:when test="./data [@alias = 'image'] != ''">
- <xsl:variable name="articlePhoto" select="umbraco.library:GetMedia(./data [@alias = 'image'], 0)" />
- <div class="col-md-3">
- <img src="$articlePhoto" />
- </div>
- </xsl:when>
- <xsl:otherwise>
- <div class="col-md-3">
- <img src="/media/1026/fake-logo.jpg" alt="{@nodeName}" style = "display:inline;width:230px;height:100px;" />
- </div>
- </xsl:otherwise>
- </xsl:choose>
- <div class="col-md-7">
- <p>
- <xsl:value-of select="umbraco.library:TruncateString(umbraco.library:StripHtml(bodyText), 200, '...')" disable-output-escaping="yes"/>
- </p>
- <a href="{umbraco.library:NiceUrl(@id)}" class="button">Continue Reading</a><span style="color:gray;float:right"><xsl:value-of select="@updateDate" /></span>
- </div>
- </article>
- </div>
- </div>
- </div>
- </div>
- </div>
- </xsl:if>
- </xsl:template>
- </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement