Posts

Showing posts with the label Content Query WebPart

Customize content query web part title link to redirect to source after pressing close on detail button

I observed that whenever we use content query web part and try to browse for the list detail page. It will come back to View All page of list instead of going back to where it was coming from. I resolved it by doing following small changes in XSL style of content query web part to fix this as per my requirement and making it consistent with other list options. Create custom style Please refer my earlier post "How to add a new indicator in a Content Query Web Part" for details of customization and before following these step 1. Edit ItemStyle.xl 2. Add following name space at the to xmlns:ddwrt=”http://schemas.microsoft.com/WebParts/v2/DataView/runtime” 3. Add <xsl:param name=”PageUrl” /> just after name space declarations. This will define a variable Page URL and populate it with current page URL 4. In your custom template add following line before processing of title <xsl:variable name=”CustomPageLink” select=”concat($SafeLinkUrl,’&amp;Source=’,$PageUrl)” /> ...

How to add a new indicator in a Content Query Web Part

Content Query web part doesn't show New! status indicator for new items by default. In order to add new indicator a customization of content query web part will be required. Following steps define the process for adding new container 1. Open SharePoint Designer and connect to your site 2. Browse to following path from SharePoint Designer StyleLibrary->XSL Style Sheets->Item Style.xsl 3. Above xsl contains style templaes that can be selected from Content Query web part's properties. You need to implement your custom template. 4. Copy any suitable template that can become base for your custom style. I would prefer to copy default template 5. Paste template at the end of file before </xsl:stylesheet> end tag 6. Change name to your style name e.g. CustomStyle and match to custom style e.g. Row[@Style='CustomStyle'] 7. Need to add following declaration at top of the file with other declarations xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/r...

Using content query web part

A Content Query Web Part displays a dynamic view of content on a page in your Microsoft Office SharePoint Server 2007 site. The Web Part runs a query that can span lists and sites in your site collection, and then presents the results of that query on the page. You can, for example, use this Web Part to display the five most recently published articles in your Web site, regardless of where they are stored. By default, the XSL style sheet that controls the presentation of the Content Query Web Part renders the Title, Description, ImageUrl, and LinkUrl columns (if present) of the items the query returns. The Web Part renders the ImageUrl and LinkUrl columns as an image and as a hyperlink, respectively. The Content Query Web Part uses XSL style sheets to render these columns by default. If you want to query for custom content types and render specific columns from those content types in the Web Part, you need to perform some minor customization in the .webpart file. Follow these steps in ...