PANVEGA’s Blog

DotNet Development, SharePoint Customizing, Silverlight, MS Infrastructure and other tips and tricks

Posts Tagged ‘XSLT’

Adding a Property to the Advanced People Search and a Column to the People Result Webpart

Posted by PANVEGA on June 9, 2009

A customer asked me to adding a Property Field called “Manager”  in the People Search Advanced Mode. For this demonstration I added  custom property called “Manger” to the profile properties, and in the following walkthrough I will show how to add searching on that property to the advanced search screen of the people search. In addition how to add this new field the your Search Core Results Webpart results. Tis how to is devided in 2 main parts. Read the rest of this entry »

Advertisements

Posted in Administration, MOSS, WebParts, XML, XSLT | Tagged: , , , , | 6 Comments »

Retrieve all available values “Itemstyles.xsl”

Posted by PANVEGA on April 16, 2009

A good practice to follow when you are going to use some fields from a List or a Library in your ContentQuery Webpart is to retreive all available values.

You can find this file in the document library called ‘Style Library’ in the root of the site collection ( /Style Library/XSL Style Sheets/ItemStyle.xsl ). Open the file in an editor of choice (eg. Microsoft Office SharePoint Designer). Next check it out to be able to make changes to the file.

More about CQWP and Webparts in general follow these  links to one of my posts:

https://panvega.wordpress.com/2009/01/07/introduction-in-the-content-query-webpart

https://panvega.wordpress.com/2008/06/03/customize-itemstylexsl-for-contentquery-webpart

At the bottom of the XSL sheet, right before the </xsl:stylesheet>, I put in the following code:

<xsl:template name="ShowValues" match="Row[@Style='ShowValues']" mode="itemstyle">
  <xsl:for-each select="@*">
    P:<xsl:value-of select="name()" /><br />
    V:<xsl:value-of select="." /><br /><br />
  </xsl:for-each>
</xsl:template>

This comes in handy when you are trying to write custom code in your web part and need the “proper” name of a field opposed to the GUID (e.g. “General Information” would be “General_x0020_Information”). The “P” is the parameter in the case above and the “V” is the value being passed. In some cases the stored field name is differenr from the current presentet value.

This works for any web part that is referencing your new custom Item Style XSL file.

Posted in CSS, MOSS, XSLT | Tagged: , , | 2 Comments »

CQWP Remove Markup from escaped page content

Posted by PANVEGA on March 18, 2009

I created a CQWP Template for displaying Items with some formatted Rich-Text Content. Nothing special. In addition the Rich-Text Description field should only display the first 180 letters and here is the small issue. An advanced Rich-Text field creates a div class around each content.

<div class=ExternalClassD7864B0CF5B14386AF6CB349205DC792> <div><font size=2>documental que toda compañía precisa: Flujos en Serie Flujos Paralelos (varios aprobadores) …

Read the rest of this entry »

Posted in MOSS, WebParts, XSLT | Tagged: , , | Leave a Comment »

Customizing Styles of Table of Contents WebPart (TOC)

Posted by PANVEGA on February 11, 2009

I this post I gonna show you how easy it is to customize the default Tabel of Contents Webpart. This webpart can list pages, lists and subsites of a specific site, and this in a custom organization and presentation. When using it on the default master page, it shows the content in different levels with some nice indentation applied to it. The main modification is to the XSLT that the web part uses when rendering the contents.

the TOC Web Part consists of the following files to amend:

  • Header.xsl
  • LevelStyle.xsl
  • TableOfContentsMain.xsl

The solution  is adding custom CSS styles unit to the xsl templates. Luckily, the table of contents is one of those webparts which uses XSL style sheets to format its data and makes those available in the Style Library within your SharePoint site collection. Once inside this style sheet (LevelStyle.xsl), one can easily be edited to the different styles. Read the rest of this entry »

Posted in CSS, MOSS, SPDesigner, WebParts, XSLT | Tagged: , , , , | 9 Comments »

Approaches when customizing a DataView WebPart (DVWP)

Posted by PANVEGA on February 7, 2009

In this post I wanna show some tricky approaches when customizing  DataView Webparts (DVWP) in the SP Designer. Maybe the approaches can save you a lot of time. Actually you can customize the weparts view how ever you wish. Customize the Filtering, Grouping and Sorting values in the dvt_1.toolbar template. Present the information with your own CSS classes. Replace the default .ms-toolbar class in the core.css.

Creating the initial dataview can be done on a virtual machine, so there is no risk of breaking anything (and development is easier when you don’t have to deal with the VPN). In SharePoint Designer, create a dataview on any list and convert it to xsl. Don’t make any changes before the conversion, as the conversion doesn’t always work that well.

Introduction:

Microsoft Windows SharePoint Services provides the powerful Data View Web Part that can perform an Extensible Stylesheet Language Transformation (XSLT) on XML data retrieved from a data source. When you are working with a Web site based on Windows SharePoint Services from within Microsoft Office FrontPage 2003, you can use the Data View Web Part to do the following:

  • Define a query and data source from which to retrieve the XML data. Data sources can be SharePoint lists or external databases such as Microsoft SQL Server.
  • Define the XSLT transformation that converts XML retrieved from the data source into HTML. FrontPage offers a WYSIWYG experience for editing these XSLT views, including live data preview. Read the rest of this entry »

Posted in MOSS, SPDesigner, WebParts, XML, XSLT | Tagged: , , , , | 7 Comments »

Calling a recursive template instead of a Split String function in XSLT

Posted by PANVEGA on January 15, 2009

When I wanted to try to access a multiple Lookup field the values are seperated in one String like this:

one; two; three; four; five  etc.

In the next step I wanted to write the values in seperate fields and add the values for URL Encoding parameters. The best way to accessing the Lookup String is to use a XSL recursive solution.I have to use this way, because in XSLT you do not have a split string function to write each value in an array.

Here is an example:

I have created an XSLT template that parses the standard ICS format and transforms it into XHTML. Here is the code that parses the properties of the ICS file into a list of properties that can be displayed in XHTML. Feed the $ical-data-raw parameter with ICS data and you will get XHTML formatted properties.

Read the rest of this entry »

Posted in C#, MOSS, XSLT | Tagged: , , | Leave a Comment »

Create a rotation banner in a CQWP

Posted by PANVEGA on January 13, 2009

In this post I am gonna explain how easy it is to create a custom banner function in a CQWP by adding some JavaScript code. The goal is to show a Title with a hyperlink and a short description in a rotation banner function. The Content will be referenced from a Custom SP List with these fileds. Read the rest of this entry »

Posted in Delegate Controls, JavaScript, MOSS, SPDesigner, WebParts | Tagged: , , , , , | Leave a Comment »

Introduction in the Content Query Webpart

Posted by PANVEGA on January 7, 2009

Microsoft Office SharePoint Server 2007 introduces a lot of new web parts, one of them being the Content Query Web Part. This Web Part is part of the “Web Content Management” features of Microsoft Office SharePoint Server 2007 and in order to use it you need to turn on the Publishing feature on a site. It is not available in a default Windows SharePoint Services v3 installation.

Using the Content Query Web Part you can display a dynamic view of content from your site on a web page. The web part can be configured to retrieve items from a single list, a single site and subsites or the entire site collection. It builds a CAML (Collaborative Application Markup Language) query and uses the new Microsoft.SharePoint.SPSiteDataQuery class to query the server. Filtering, sorting, ordering and grouping can all be configured in the Web Part properties.

Displaying the results can be done by choosing one of the default item layout styles. The default item layout styles cover basic formatting with bullets, images and font size.

default layout
Content Query Web Part: default layout

Read the rest of this entry »

Posted in MOSS, WebParts, XSLT | Tagged: , | 5 Comments »

ddwrt:FormatDate with different FormatFlags

Posted by PANVEGA on December 8, 2008

I needed to use the ddwrt functions in my content query web part. Using the FormatFlags you can easily transform the format you wish.

Add the following namespace attribute to the root xsl:stylesheet element

xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"

This provided more examples of the FormatDateTime formatting codes (like YYYYMMDDThh:mm):

http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx

Here’s a list of languages with their LCID:

http://support.microsoft.com/default.aspx?id=221435

Language packs for Office SharePoint Server 2007 are not bundled into multilingual installation packages. You must install a specific language pack for each language that you want to support. Also, language packs must be installed on each of your front-end Web servers to ensure that each Web server can render content in the specified language.

The following table lists the language packs that are available for Office SharePoint Server 2007.

German Germany 1031
English United States 1033
Japanese Japan 1041

Read the rest of this entry »

Posted in MOSS, WebParts, XSLT | Tagged: , | 4 Comments »

Customize ItemStyle.xsl for ContentQuery Webpart

Posted by PANVEGA on June 3, 2008

If you want to preserve the look and feel of a Web page by applying certain custom styles to the page content by including a WepPart, you can change the definition of style sheets “ItemStyles.xsl” without affecting the page content in the future.You find the file in under your domain/Style Library/XSL Style Sheets. Open the file in an editor of choice (eg. Microsoft Office SharePoint Designer). Next check it out to be able to make changes to the file. Read the rest of this entry »

Posted in MOSS, WebParts | Tagged: , , , | 8 Comments »

How to add a JS ToolTip into a custom Webpart?

Posted by PANVEGA on May 16, 2008

Sometimes it is very useful, for instance you wanna show for a download document library a small popup window with a preview Image of the first page. This can be a simple JS mouse over event.

With Javascript generated tooltips we can include anything that we can code using HTML including graphics and even code generated from other Javascripts. This will make our tooltips much more flexible in what they can display and hopefully much more useful to your visitors. The only thing that you do need to keep in mind is that your visitor will be unable to interact with the tooltip content using their mouse since as soon as they move their mouse from over the link to which the tooltip is attached, the tooltip will disappear. Read the rest of this entry »

Posted in JavaScript, MasterPage, MOSS, WebParts, XSLT | Tagged: , , , | 4 Comments »

Custom Workflow Activity combined with InfoPath and XSLT

Posted by PANVEGA on May 4, 2008

In my case I needed a custom workflow activity in order to send a email notification to some users. In addition the workflow triggers when a new InfoPath XSN formular was created. And exactly here was my problem.

In my InfoPath Formular there are some repeating sections which should be transformed via XSLT and CSS in the presented email body.  By default the SP Designer workflow Email activity can not 100% realize the repeating sections. So I developed a custom activity in Visual Studion which links to a specific XSLT file.

InfoPath –> MOSS –> (XSLT, CSS) HTML

Read the rest of this entry »

Posted in DotNet, InfoPath, MOSS, XSLT | Tagged: , , , | Leave a Comment »