Showing posts with label WePart. Show all posts
Showing posts with label WePart. Show all posts

Friday, June 1, 2012

XSLT template display part of article as summary

When created news, articles, and etc..., I want to take part of article as summary displayed in listing and headlines.I Created XSLT which can be used for this functionality:


<xsl:template name="trimPara">
    <!-- pass the string to be cropped with required string length -->
    <xsl:param name="stringLenRequired"/>
    <xsl:param name="stringInput"/>
    <xsl:value-of disable-output-escaping="yes" select="substring($stringInput,1,number($stringLenRequired))"/>
    <xsl:value-of disable-output-escaping="yes" select="substring-before(concat(substring($stringInput,number($stringLenRequired)+1,number($stringLenRequired) +20),' ' ),' ')"/>
    <!-- to make it a full word -->
    <xsl:if test="string-length($stringInput) > number($stringLenRequired)">...</xsl:if>
  </xsl:template>



You can call this template by the following:


   <xsl:call-template name="trimPara">
            <xsl:with-param  name="stringLenRequired">200</xsl:with-param>
            <xsl:with-param name="stringInput" select="@Body"/>
          </xsl:call-template>
        </div>


Tuesday, July 15, 2008

How to remove a bad webpart from a page?

Previously, I added a poorly written webpart to my default.aspx page. The consequence of this action is that you aren't able anymore to load the page. In this case, the only thing you have to do is to remove the webpart. Removing the webpart in the webpart gallery doesn't solve this.
Resolution:
Append ?Contents=1 to the webpart page's URL to display the Webpart Maintenance Page. On that page you can delete the malefactor.
Example: http://moss/default.aspx?contents=1