Hot answers tagged

10

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


10

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


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


5

There is no issue with the equals sign, the issue is with the ampersand, that has to be escaped as &amp; https://stackoverflow.com/questions/1328538/how-do-i-escape-ampersands-in-xml There are 5 characters that need to be escaped in XML: " &quot; ' &apos; < &lt; > &gt; & &amp; https://stackoverflow.com/...


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

If you can add a script editor, you can do something like this: So the heading is complete 20px. If you want this for only one column you have to use the developer tools (F12) to find your element. Hope this gives you a starting point. Update 1: Here where I found the class:


3

(function () { var ctxForm = {}; ctxForm.Templates = {}; ctxForm.OnPreRender = preTaskFormRenderer; SPClientTemplates.TemplateManager.RegisterTemplateOverrides(ctxForm); function preTaskFormRenderer(overrideCtx) { modifyHeaderData(overrideCtx); } function modifyHeaderData(overrideCtx) { var ...


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


3

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


3

You have to do a couple things. First, you might need to make sure your xsl connector has this parameter binding: <ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/> And make sure this is in there: xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" Then, add this parameter to give your xsl ...


3

I understand this is an older post but I was struggling with this same issue over the past couple days and have found a solution I thought I would share. The trick is in understanding how the CQWP actually builds the XML structure. You can see this by editing the ContentQueryMain.xsl (found at /Style Library/XSL Style Sheets) by adding a new template that ...


3

Add content editor web part, hide layout in settings <style> .ms-ellipsis-icon {display:none;} .ms-pivotControl-surfacedOpt, .ms-pivotControl-overflowDot {display:none;} </style>


3

You could export the content query web part and open it in notepad. Then define the MainXslLink and ItemXslLink property values as "/rootsite/subsite/style library/xsl style sheets/Xslfile name.xsl" in the content query web part. And you also could change the url of the xsl file. Make sure there is a major version of the published xsl. There is a similar ...


3

I resolved this issue by making changes in date format as below <xsl:value-of select="ddwrt:FormatDateTime(string(@EventDate),3081,'dddd,d MMMM,yyyy')"/>


2

Try this: <xsl:variable name="date" select="ddwrt:FormatDate(string(@EventDate), 1033, 1)"/> <xsl:variable name="day" select="format-number(substring-before(substring-after($date,'/'),'/'),'00.')"/> <xsl:variable name="month" select="format-number(substring-before($date,'/'),'00.')"/> <xsl:variable name="year" select="format-number(...


2

For parts 1 and 2 of your question: Not sure if this helps (I'm on SharePoint Online [2013]), but try using the SharePoint:CreatedModifiedInfo tag as suggested here to show properly hyperlinked version rather than all of the HTML tags. It worked for a custom field I did, though I had to remove an extra line of code from the original answer to avoid a ...


2

There are a few advantages of using Client Side Rendering VS XSL. Performance – Because the rendering is done Client Side, the burden is taken away from the server. This means that the pages can load faster when using CSR. Ease of Development – Let's face it: nobody really likes XSL – especially in SharePoint. All web developers should be ...


2

Thank you Nizar for pointing me in the right direction, I was able to use the majority of your answer however I noticed that I encountered some strange issues with HTML within the body of the post and it affecting how many words were displayed. As a result I went with the following steps: Create a new version of the blog.xsl file located in: C:\Program ...


2

See XSLT special condition for first row You can do it by specifying a special template for the first element like this: <xsl:template match="row[1]"> ... html with image </xsl:template> <xsl:template match="row"> ... html without image </xsl:template> or by using an if inside a foreach <xsl:template match="rows"> <...


2

I'll answer my own question: I couldn't make my views and display forms work with xsl:import, so I had to use xsl:include. Xsl:include caches the included xsl and does not refresh when the included xsl file is changed - this is by design as explained in this thread. So after all I couldn't use it. I resolved my issue by using 'xsl link' property for the ...


2

You could either change the XSLT that renders the blog article (recommended) Create your own XSL template that does truncating and adds a link (link is same as the article id) There are some XSLT functions that strips off the HTML tags, you may have to use that. or edit the page and insert a piece of javascript that Truncates the body content of the blog ...


2

When you create a calculated column you choose what format the output should be and date is one of the options while string is the default. Another option in your case could be substring to remove the elements of the string that you do not want: select="substring-before(substring-after(@Group,'#'),')')"


2

How to pass list item Id in Xsl for List View: <a> <xsl:attribute name="href">javascript:openDialog(<xsl:value-of select="$thisNode/@ID"/>);</xsl:attribute> <xsl:value-of select="$thisNode/@Title"/> </a> Example of customizing field in SharePoint 2010 The following template <xsl:template name="...


2

Svet, as was pointed in the original answer, there are two options how to customize List View via XSLT: Inline editing of xsl using SharePoint Designer as described in article Create a custom list view using SharePoint Designer create a custom xsl template for a List View and apply it via XSL Link property of XLV web part (i usually prefer this method) ...


2

Here are some links to create visual web part in visual studio : https://www.youtube.com/watch?v=9iK8IPUB87w http://www.sharepoint-journey.com/visual-webpart-in-sharepoint-2013.html There are multiple methods to capture XML from a URL, but this particular example is helpful when you are dealing with special characters of foreign languages. The loaded XML ...


2

This makes no sense to me but... It appears that SharePoint XSLT for CQWP doesn't like empty elements. When I have an empty div it pulls the next element in the DOM into the parent of the empty element. My code had clearing divs at the end of the main containers so getting rid of those resolved the issue.


2

Try this. <xsl:value-of select="ddwrt:UserLookup(string($Userid) ,'ID')" /> You had "," after UserLookup.


2

I finally got it to work! In my case, for some reason, there is something wrong with the $Today variable so instead I did this and it worked for me: <xsl:if test="ddwrt:DateTimeTick(ddwrt:GenDisplayName(string($thisNode/@Due_x0020_Date0))) &lt;= ddwrt:DateTimeTick(ddwrt:GenDisplayName(string(ddwrt:Today())))"> background-color: ...


2

You need to at minimum recycle the application pool so that SharePoint can cache the changes made to the file. IISRESET will make sure the change get picked up for all the web applications.


2

<xsl:value-of "@FileLeafRef /> should get you most if not all of what you want. Some of it will have to be built manually or by using server variables, http://sympmarc.com/2007/10/19/data-view-web-part-parameters-based-on-server-variables/. In that case, you would just use a concat to string them all together, <xsl:value-of "concat($SomeVariable,"/...


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