javascript - Limit the number of lines in XSLT item -


in sharepoint 2013, using data view xslt web part want limit number of rows per item (not number of items returned in general). sow few suggestions in javascript find div height , divide in line height property, since i'm using xsl wonder if there other way? looked solutions in css there nothing there.

thank you

here xslt (i want limit number of lines div "administrativeposts"):

<xsl> <xsl:stylesheet xmlns:x="http://www.w3.org/2001/xmlschema"xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/webparts/v2/dataview/runtime" xmlns:asp="http://schemas.microsoft.com/aspnet/20" xmlns:__designer="http://schemas.microsoft.com/webparts/v2/dataview/designer" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:sharepoint="microsoft.sharepoint.webcontrols" xmlns:ddwrt2="urn:frontpage:internal"> <xsl:output method="html" indent="no"/> <xsl:decimal-format nan=""/> <xsl:param name="dvt_apos">&apos;</xsl:param> <xsl:param name="manualrefresh"></xsl:param><xsl:variable name="dvt_1_automode">0</xsl:variable> <xsl:template match="/" xmlns:x="http://www.w3.org/2001/xmlschema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" xmlns:asp="http://schemas.microsoft.com/aspnet/20" xmlns:__designer="http://schemas.microsoft.com/webparts/v2/dataview/designer" xmlns:sharepoint="microsoft.sharepoint.webcontrols"> <xsl:choose> <xsl:when test="($manualrefresh = 'true')">             <table width="100%" border="0" cellpadding="0" cellspacing="0">                 <tr>                     <td valign="top">                         <xsl:call-template name="dvt_1"/>                     </td>                     <td width="1%" class="ms-vb" valign="top">                         <img src="/_layouts/15/images/staticrefresh.gif" id="manualrefresh" border="0" onclick="javascript: {ddwrt:genfireserverevent('__cancel')}" alt="click here refresh dataview."/>                     </td>                 </tr>             </table>         </xsl:when>             <xsl:otherwise>                 <xsl:call-template name="dvt_1"/>         </xsl:otherwise>                 </xsl:choose> </xsl:template>              <xsl:template name="dvt_1">                 <xsl:variable name="dvt_stylename">table</xsl:variable>                 <xsl:variable name="rows" select="/dsqueryresponse/rows/row"/>                 <xsl:variable name="rowlimit" select="1" />                 <div class="administrativeposts">                                        <xsl:call-template name="dvt_1.body">                         <xsl:with-param name="rows" select="$rows"/>                         <xsl:with-param name="firstrow" select="1" />                         <xsl:with-param name="lastrow" select="$rowlimit" />                     </xsl:call-template>             </div>         </xsl:template>                 <xsl:template name="dvt_1.body">                     <xsl:param name="rows"/>                     <xsl:param name="firstrow" />                     <xsl:param name="lastrow" />                     <xsl:for-each select="$rows">                         <xsl:variable name="dvt_keepitemstogether" select="false()" />                         <xsl:variable name="dvt_hidegroupdetail" select="false()" />                         <xsl:if test="(position() &gt;= $firstrow , position() &lt;= $lastrow) or $dvt_keepitemstogether">                             <xsl:if test="not($dvt_hidegroupdetail)" ddwrt:cf_ignore="1">                                 <xsl:call-template name="dvt_1.rowview" />                         </xsl:if>                     </xsl:if>                 </xsl:for-each> </xsl:template>                             <xsl:template name="dvt_1.rowview">                  <xsl:value-of select="@body" disable-output-escaping="yes"/>     </xsl:template>         </xsl:stylesheet></xsl> 

and result:

lorem ipsum dummy text of printing , typesetting industry. lorem ipsum has been industry's standard dummy text ever since 1500s, when unknown printer took galley of type , scrambled make type specimen book. has survived not 5 centuries, leap electronic typesetting, remaining unchanged. popularised in 1960s release of letraset sheets containing lorem ipsum passages, , more desktop publishing software aldus pagemaker including versions of lorem ipsum.

but want show first 5 lines never mind width of div is, characters limitation not work here.

thanks.

but want show first 5 lines never mind width of div is, characters limitation not work here.

you're not alone. here similar questions:

good luck.

references


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -