Showing posts with label Web Parts. Show all posts
Showing posts with label Web Parts. Show all posts

Thursday, December 12, 2013

SharePoint 2010 – Table of Contents Web Part – Sites Missing

Just noticed that some subsites were not listed in my Table of Contents web part... here's why (thanks to Scott Ellis): http://digitalmacgyver.wordpress.com/2011/09/23/sharepoint-2010-table-of-contents-webpartsites-missing/


20 is the default number of links visible on the Global and Quick Launch navigation settings.

Here's how to change this:

  • Go to the site where you have the Table of Contents web part displayed.
  • Navigate to Site Settings > Navigation
  • Under 'Current Navigation' change the value of '' from 20 to the number you need to display.
The Table of Contents should now show all the sites.

Wednesday, June 01, 2011

Grouping list data in XSLT

I used a linked XSL file to override the output of my list web part, grouped by one of my custom columns called 'Classification'.

To add in an XSL override link to your XSL file via the list web part properties:


XSL (uploaded to a SharePoint Document library):

<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:output method="html" indent="yes" version="4.0"/>
<xsl:template match="/">
<xsl:call-template name="MyTemplate" />
</xsl:template>
<xsl:key name="classificationKey" match="Row" use="@Classification" />
<xsl:key name="associatedTitle" match="Row" use="@Title" />
<xsl:template name="MyTemplate">
<xsl:for-each select="/dsQueryResponse/Rows/Row[generate-id(.)=generate-id(key('classificationKey', @Classification))]">
<h3><xsl:value-of select="@Classification" /></h3>
<xsl:variable name="thisClassification" select="@Classification" />
<xsl:for-each select="../Row[generate-id()=generate-id(key('associatedTitle', @Title)[@Classification = $thisClassification][1])]">
<div>
<strong>Title: </strong>
<xsl:value-of select="@Title" /><br/>
<strong>Description: </strong>
<xsl:value-of select="@Description" disable-output-escaping="yes" /><br/>
<strong>Link: </strong>
<a href="{@Link}" title="{@Title}"><xsl:value-of select="@Link"/></a>
</div>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>


This is the output:

Classification 1

Title 1
Description 1
Title 2
Description 2
Title 3
Description 3

Classification 2

Title 4
Description 4
Title 5
Description 5

Sunday, January 16, 2011

Open a Closed Web Part

To open a 'closed' web part:
  1. Open the page in 'Edit' mode.
  2. Click on a zone 'Add a web part' link.
  3. In the 'Categories' list select 'Closed Web Parts'
  4. Add the web part to the page.

Tuesday, June 17, 2008

SharePoint RSS Viewer Error

Having added the SharePoint OOB RSS web part on to my site and configured it to point to a feed i received the following error in the log:

RssWebPart: Exception handed to HandleRuntimeException.HandleException System.Net.WebException: Unable to connect to the remote server

Found the solution here: http://yasirbutt.spaces.live.com/blog/cns!A8677D5751E6B4DA!1409.entry

The following needs adding to the site web.config file (at the bottom of the file):

<system.net>
<defaultProxy>
<proxy usesystemdefault = "false" proxyaddress="http://proxyservername" bypassonlocal="true" />
</defaultProxy>
</system.net>

Wednesday, May 21, 2008

Content Query Web Part - Custom Item Style

  1. Open SharePoint Designer and go to the site Style Library
  2. Open the file: ItemStyle.xml
  3. Copy the following code or one of the existing styles from the XML
  4. Modify the XML as required; for example the code below places an image on the left of a title, in this case used for portal news headlines.
  5. Check in the XML file
  6. Refresh the page you are editing the CQWP on and open the Presentation section of the CQWP edit panel. The new style should now be listed under Item Style.













<xsl:template name="NewsHeadline" match="Row[@Style='NewsHeadline']" 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="SafeImageUrl">
<xsl:call-template name="OuterTemplate.GetSafeStaticUrl">
<xsl:with-param name="UrlColumnName" select="'ImageUrl'"/>
</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="LinkTarget">
<xsl:if test="@OpenInNewWindow = 'True'" >_blank</xsl:if>
</xsl:variable>
<div id="linkitem" class="item">
<xsl:if test="string-length($SafeImageUrl) != 0">
<div class="image-area-left">
<a href="{$SafeLinkUrl}" target="{$LinkTarget}">
<img class="image" src="{$SafeImageUrl}" alt="{@ImageUrlAltText}" />
</a>
</div>
</xsl:if>
<div class="link-item">
<xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/>
<strong><a href="{$SafeLinkUrl}" target="{$LinkTarget}" title="{@LinkToolTip}">
<xsl:value-of select="$DisplayTitle"/>
</a></strong>
</div>
</div>
</xsl:template>

Wednesday, May 16, 2007

Deploying Web Parts using CAB files

  1. For ease of deployment, copy the .cab file to the following location, where Office SharePoint Server 2007 is installed:

    C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\bin

    This should be the same as the location of Stsadm.exe. Ensure that you update the path on your computer if it does not match the default location.

  2. Click Start, click Run, and then type cmd.

  3. Type cd "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\bin"

  4. Run the following command to deploy your Web Part accross the entire farm:

    stsadm.exe -o addwppack -filename yourcabfilename.cab -globalinstall -force

  5. Run the following command to deploy your Web Part to a specific website:

    stsadm.exe -o addwppack -filename yourcabfilename.cab -url http://teleport -globalinstall -force

  6. After the command returns with "Operation completed successfully," run the following command:

    iisreset /timeout:0

  7. Check central administration / solution management to see where the solutions are registered as deployed by SharePoint.