Hot answers tagged

23

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 ...


11

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, ...


8

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')"/>


8

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 ...


8

It depends on what you want to do with it. The power of using JSLink is that it uses JavaScript and runs in the client and you can use all the powerfull JavaScript libraries and for its easy to debug. It is easy to change the fields appearing and add some nice functionality to views. The weakness however is that JSLink runs in the client and it depends ...


7

There are just a few easy steps to follow in order to customise you blog page, the best way is to edit the blog.xsl file responsibl of rendring the blog posts. The standard SharePoint 2010 default page looklike : Assuming that you have already created a blog site, let's go to the 14 hive of your server and edit the blog.xsl file. C:\Program Files\Common ...


7

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

Use the following URL to get XML of list:- http://{0}/_vti_bin/owssvr.dll?Cmd=Display&List={1}&XMLDATA=TRUE {0} – The URL to your site. This could be the root web or a child site. {1} – The GUID for your list. To find the GUID for a list, just go to the Settings page for the list and copy it from the URL. Use the following URL to get XML of ...


5

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 ...


5

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 ...


5

There's an attribute you add to xsl:value-of called "disable-output-escaping". So change your line to look like this: <xsl:value-of select="@MyColumn" disable-output-escaping="yes"/>


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 expand the group, the listview webpart does callback(and not postback) to retrieve the data. While callback, the value of url parameter is not passed (unless you set a default value) and so you don't see data. To make it work : 1) Right click webpart 2) Go to webpart properties 3) Under "Ajax Options", Check "Enable Asynchronous update" 4) Click ...


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

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 ...


4

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>


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

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:- ...


4

The format of the Image with formatting and constraints for publishing is already with the image HTML tags. Ex.: <img alt="" src="Docs/Image.png" style="border: 0px solid" /> So you could try to do the following: <xsl:value-of select="substring-before(substring-after(@ImageField, 'src=&quot;'), '&quot; style')" />


4

Just replace 2057 with 1036 (the LCID of fr-FR) and it should render the date in a French format. The possible values for the third parameter, which control what type of date string is rendered, are listed in the MSDN blog post “Custom Date Formats in SharePoint XSL”.


4

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 ...


4

You don't need to manipulate the web part settings manually in the code. These settings are also available on the ribbon. Select the DVWP in SharePoint Designer 2010 in Design View and then use the Paging command on the Options ribbon of the Data View Tools:


3

As I understand it, XSL is server-side and JS is client-side so you are trying to mix two incompatible layers. What you can do is include a reference to a JS script within your XSL which will then run against the rendered output. In the example you mention, you could potentially render both language versions using your XSL and then hide whichever you ...


3

Add 'disable-output-escaping="yes"' in your xslt Example: <xsl:value-of select="@Detail" disable-output-escaping="yes" /> This will fix your problem.


3

Try using the XSLT substring-before function: <xsl:value-of select="substring-before(@Department,'|')" disable-output-escaping="yes">


3

Dave's solution fixes your problem with assumption your data always contains a |. If you want to make your solution a little more robust you could also write this: <xsl:value-of select="substring-before(concat(@Department, '|'), '|')" disable-output-escaping="yes"></xsl:value-of></a> This will also work in the case that the string ...


3

I was able to do it by modifying the ContentQueryMain.xsl file to insert non-repeating markup before and after content query as shown here. http://blog.mastykarz.nl/wrapping-contents-content-query-web-part-additional-markup/


3

In order to define Custom Rendering for a SPFieldChoice in template for mode attribute should be used value body For example, if we apply for Tasks list that contains Status field (SPFieldChoice) the following XSLT style sheet <xsl:template match ="FieldRef[@Name='Status']" mode="body"> <xsl:param name="thisNode" select="."/> ...


3

I believe it is related with invoking template for a field, it means that in your case this template is not invoked at all. In order to render field using your template the following attributes should be specified in template: a) mode DateTime_body b) match(matches field by internal name in that case) <xsl:template ...



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