Tag Info

Hot answers tagged

14

I expect you have "BaseViewID" attribute set to "0" on the "View" element of your custom list definition. You should change this attribute to some other value (in range 1..255) and the problem should vanish then. Although this is actually all you need to solve the issue, I anticipate you might want some more detailed explanations :) Actually, BaseViewID is ...


9

You can use ParameterBindings to this purpose. <ParameterBinding Name="Language" Location="Resource(wss,language_value)" /> This will return "en-us" for English locale in xsl:param "Language". Also, you can pass whole resource values this way. You can read more about this in Stefan Stanev's blog: ...


8

Actually you don't need to modify the OOTB files. In fact, it's a very bad idea, since Microsoft doesn't support modifying any of OOTB files in Layouts directory, except of DocIcon.xml. Any cumulative update or SharePoint service pack can replace these files, so your customizations will vanish in one moment. What you need to do, is to create your own file, ...


6

You can filter list by using CAML and DaysOffset attribute of the Today tag. This can be done even from GUI. For example, this filter will narrow the shown items of a list view to those, which have Due date within a week from the current date: (List Tools => List => Modify view on the contextual ribbon) In terms of CAML, this will produce the following ...


6

I'm not sure if XSLT 1.0 have today's date method. However, XSLT 2.0 has an equivalent current-date() Have you tried? ddwrt:Today() <xsl:value-of select="ddwrt:Today()"/> ddwrt:TodayIso() <xsl:value-of select="ddwrt:FormatDateTime(ddwrt:Today(),1033,'yyyyMMdd')"/>


6

When you add a DVWP to the page in SharePoint Designer, SPD defined a variable which contains the current date for you in the ParameterBindings section: <ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/> Be sure to declare Today as a param at the top of the stylesheet: <xsl:param name="Today" /> Then you can ...


4

Don't be afraid of XSLT. This is going to give you a tremendous amount of power without having to develop or deploy anything in return for a little effort to understand it. I always recommend starting with an identity transform so that you can see the XML that is coming in, and then start adding templates to process the nodes you are interested in. Visual ...


4

Use the xsl:choose block, with an xsl:if test to see if your URL is empty or not. something like this: <xsl:choose> <xsl:when test="string-length($urlField) = 0"> // do stuff </xsl:when> <xsl:otherwise> // show nothing </xsl:otherwise> </xsl:choose>


4

I am adding this so that others who stumble accross it might find it useful. I got this to work by adding a __redirect to the GenFireServerEvent like this: onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={WhateverPage.aspx?IsDlg=5'})" Then on this page add something like this: _spBodyOnLoadFunctionNames.push("closeme"); function ...


4

When you change a page in SPD, it becomes customized (unghosted). Thus, GhostedXslLink no longer works. More details about ghosted and unghosted pages here: http://www.etechplanet.com/blog/ghosted-and-unghosted-pages-in-sharepoint.aspx You should use XslLink property instead of GhostedXslLink for unghosted pages. Just change it in the property editor in ...


3

You'll need to use the Xsl:If function to ascertain whether or not the banner has anything in it to display. In the example below, I'm just testing the $SafeImageUrl variable that the content query webpart supplies out of the box. <xsl:if test="string-length($SafeImageUrl) !=0"> <img class="image" src="{$SafeImageUrl}" ...


3

Marc Anderson has a blog post that covers stripping HTML from rich text fields to display the first n number of characters of a field. You can probably use a portion of his post to accomplish what you're looking to do: http://mdasblog.wordpress.com/2009/01/20/displaying-the-first-n-words-of-a-long-text-column-with-xsl/


3

At first glance, you are closing off your xsl param in the first line. Then you have an unnecessary and mistyped closing xsl param tag which can be removed. You'll also want to include an xsl:otherwise so that if no multiple selection is made, the text is returned. This might be helpful, look at question 1. You'll need to do a recursive template to do ...


3

Original root template for XsltListViewWebPart comes from 14/TEMPLATE/LAYOUTS/XSL/vwstyles.xsl file. The code is as follows: <xsl:template match="/"> <xsl:choose> <xsl:when test="$RenderCTXOnly='True'"> <xsl:call-template name="CTXGeneration"/> </xsl:when> <xsl:when test="($ManualRefresh = 'True')"> ...


3

Are you just doing this on a field by field basis? If so then you can override the rendering template for a particular field using fldtypes.xsl files. Drop these into templates/layouts/xsl and they magically work. So if you had a custom field called MyBigField, you can define an XSL just for displaying that field value in a list. More info here:- ...


3

PROBLEM SOLVED :-) :-) The bug of trying to set the xsllink property through the template seems to be a recognised bug. I'm even sure MS are aware of this as when looking at how they have created their site definitions it seems pretty uninstinctive. The Solution DO NOT SET OR DEFINE THE XSLTLISTVIEWWEBPART IN THE TEMPLATE instead just define a webpart ...


3

See if this helps: <xsl:for-each select="rows\row"> <li> <a> <xsl:attribute name="href"> <xsl:value-of select="{@FileURL}" /> </xsl:attribute> <xsl:attribute ...


2

Can you check the below article and see if this solves your problem http://platinumdogs.wordpress.com/2010/03/03/sharepoint-referencing-the-current-site-url-in-a-data-view-web-part/


2

Well, I think you can use Advanced Search Box web part + Search Core Results web part or of course customize exist search page. With custom xslt in Search Core Result web part (and some other settings, as main with managed properties in "Selected columns") you can create any view which can depends on search results, on result item type or any item field ...


2

I found out that there's no need to encode a parameter using ddwrt:UrlEncode. So the code on the first page becomes: 1) Building the URL <xsl:variable name="MyURL" select="concat('../../Lists/MyList/MyView.aspx?ID=',@ID,'&amp;MyName=', @Title)" /> 2) Creating a hyperlink <a onclick="GoToLink(this); return false;" target="_self"> ...


2

Are you creating your own version of the CSRWP? Or are you customizing a webpart on an existing page? For both cases, you have to modify the ItemXslLink, and set it to the link to your xslt. If it's the second case, you can use the SPWeb.GetLimitedWebPartManager to change the properties of a webpart on an existing page.


2

Managed to get it working - had to do this in the XSL: <script language="javascript" defer="true"> <xsl:comment> <![CDATA[ $(document).ready( function() { alert('boo'); }); ]]> </xsl:comment> </script>


2

To do this programmatically you need to change the ListViewWebPart.ViewGuid property. There is sample code in the second part of this msdn blog post. Before you start coding, have you considered using audiences? This will allow you to show different filtered lists or hide/show web parts based on the identity of the user or groups of users.


2

I have previously had to inline the custom libraries functions into an xslt file hosted in SharePoint and linked to the xslt property in the webpart (I prefer linking to a file over adding the xslt in directly). Linking libraries seems to produce a security issue and you are certainly not allowed to reference C# functions in the xslt. In cases where I ...


2

After looking for ages for the answer to this I stumbled on it minutes after posting this question... Anyway, the answer is here: http://blogs.msdn.com/b/joshuag/archive/2009/03/25/custom-date-formats-in-sharepoint-xsl.aspx Summary: Reference the ddwrt namespace at the top of the itemstyle.xls ...


2

You were on the right track with potentially modifying GetSafeHtml :) I resolved this issue using a small tweak to said XSL in the SharePoint RSS Web Part here: Stop mixed content warnings in SharePoint's RSS Web Part Basically, you paste over the GetSafeHtml template with a slightly modified version that calls a strip-tags template. <xsl:template ...


2

Please, check out this articles: Remove all <img ... /> tags - very elegant xslt solution to remove img tags. Stripping HTML tags when using XSLT - this can be a demonstration of another approach (most likely, you can simply replace &lt; to &lt;img there to get this templates working for your situation)


2

The XSLT will basically draw a template of HTML which wraps the output of the data query. If you look through the XSLT you'll see various TR TD html elements around which draw the table. You will need to remove the TD elements which represent the column which you are trying to hide. This is easiest done with SharePoint Designer as you'll have the syntax ...


2

I think here you will need, first of all, to understand, how the conditional formatting actually works. Conditional formatting in SPD is not more than a visual way to define Xsl property of XsltListViewWebPart and other standard webparts, which use xsl transformations. Xsl property contains custom xsl code, and links to standard SharePoint xslt files, like ...


2

According the stack trace, I think the web service call is not the problem. This line is probably causing the exception : xslt.Load("http://rginfonet/Style%20Library/XSL%20Style%20Sheets/Liberty.xslt"); In fact, you are facing a douple-hop scenario. Your user connects to SP, where the webparts also try to connect to SP (even if it's local). Try to change ...



Only top voted, non community-wiki answers of a minimum length are eligible