Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

We have a List in our Sharepoint that we use for reporting quality assurance issues. One of the columns is a 'Description' column which is defined as a Rich text column, is there anyway to insert something along the lines of a <blockquote> tag into this text box? I am attempting to paste information such as a Stacktrace which I'd like to stand out.

share|improve this question
2  
Why not use Enhanced rich text? –  Shoban Apr 20 '11 at 15:38
    
I wondered the same thing myself, is there any disadvantage to converting it to that? This list is quite large (5000+ Entries) and in reality they should be using a bug tracking system as opposed to this sharepoint list, but that is neither here nor there. –  aolszowka Apr 20 '11 at 15:46
    
I don't see any disadvantage. –  Shoban Apr 20 '11 at 16:52
add comment

2 Answers

You can dump HTML into this field as long as you render it without escaping the content. It really depends on the control used to render the content of the field.

share|improve this answer
    
AFAIK this is just a standard control that shipped with sharepoint (nothing fancy?) Attempting to insert a <blockquote> did not work as expected (using IE 8 to edit the field). I know that when the sharepoint site is browsed with Firefox I am dumped to the underlying HTML (I assume because its because that editor is an ActiveX Control) I have not attempted to insert a <blockquote> there –  aolszowka Apr 20 '11 at 15:48
add comment

If you simply want to format a single column of your list using <blockquote>, you can do this using XsltListViewWebPart formatting.

To accomplish this, edit your list in SharePoint Designer (Ribbon -> List -> Edit list), and go to code tab:

code tab in SPD

Find XsltListViewWebPart tag, and add following Xsl tag:

<WebPartPages:XsltListViewWebPart runat="server" ...>
    <!-- ParameterBindings here -->
    <!-- XmlDefinition here -->
    <!-- DataFields here (empty, most likely) -->
    <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" xmlns:o="urn:schemas-microsoft-com:office:office"> 
        <xsl:include href="/_layouts/xsl/main.xsl"/> 
        <xsl:include href="/_layouts/xsl/internal.xsl"/> 

        <xsl:param name="AllRows" select="/dsQueryResponse/Rows/Row[$EntityName = '' or (position() &gt;= $FirstRow and position() &lt;= $LastRow)]"/>
        <xsl:param name="dvt_apos">&apos;</xsl:param>

        <xsl:template name="FieldRef_printTableCell_EcbAllowed.StackTrace" match="FieldRef[@Name='StackTrace']" mode="printTableCellEcbAllowed" ddwrt:dvt_mode="body" ddwrt:ghost="" xmlns:ddwrt2="urn:frontpage:internal">
            <xsl:param name="thisNode" select="."/>
            <xsl:param name="class" />

            <td>
                <blockquote>

                <xsl:if test="@ClassInfo='Menu' or @ListItemMenu='TRUE'">
                    <xsl:attribute name="height">100%</xsl:attribute>
                    <xsl:attribute name="onmouseover">OnChildItem(this)</xsl:attribute>
                </xsl:if>

                <xsl:attribute name="class">
                    <xsl:call-template name="getTDClassValue">
                        <xsl:with-param name="class" select="$class" />
                        <xsl:with-param name="Type" select="@Type"/>
                        <xsl:with-param name="ClassInfo" select="@ClassInfo"/>
                    </xsl:call-template>
                </xsl:attribute>

                <xsl:apply-templates select="." mode="PrintFieldWithECB">
                    <xsl:with-param name="thisNode" select="$thisNode"/>
                </xsl:apply-templates>

                </blockquote>
            </td>

        </xsl:template>
        </xsl:stylesheet>
    </Xsl>
</WebPartPages:XsltListViewWebPart>

I got following look after these changes:

resulting list

share|improve this answer
    
While this isn't quite what I want (the description column is a combination of free-form text, comments, stack traces, etc) this could prove useful in other places, thanks for taking the time to write up this excellent answer and including screen shots! –  aolszowka Apr 20 '11 at 18:30
    
Thanks! Anyway, XSL transformations have wide capabilities. Of course, you will need to do more code, but with xslt you even can parse bbcode! Check this question: stackoverflow.com/questions/1870423/… –  Andrey Markeev Apr 20 '11 at 18:37
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.