Posts

Showing posts from 2014

Using parameters in XSLT

If you've read some of my previous posts, you've seen examples of using parameters when calling templates. I earlier wrote about assigning XML structures to variables. Now we are going to use a variable as parameter for a template call. Create the variable and send it as a parameter to your template of choice: <!-- Given a structure like this one... --> <xsl:variable name="someVariable"> <record> <artist sex="female">Madonna</artist> <title>Like a prair</title> </record> </xsl:variable> <xsl:call-template name="targetTemplate"> <xsl:with-param name="string" select="$someVariable" /> <xsl:with-param name="attributeString" select="$someVariable/@sex"/> </xsl:call-template name="targetTemplate"> </xsl:template> Grab the variable and do something that makes sense. ;

Set the logo of all sites in a SharePoint 2013 site collection using PowerShell - Flash post

If you want to quickly set the site logo of a complete SharePoint 2013 site collection, enter the following: (get-spsite  http://YourSiteCollectionURL ).AllWebs | foreach {$_.SiteLogoUrl = “/relative/path/to/companylogo.png”; $_.Update()} Thats all :)

Open termbased navigation links in new window in SharePoint 2013

Term based navigation has been greatly improved in SharePoint 2013, but sometimes you want to open navigation URLs in a new window. However, the term store does not offer such a property so we'll solve it using JavaScript instead. In the masterpage element add this script: script language="JavaScript" // Adding an entry to _spBodyOnLoadFunctionNames array so the function runs on pageLoad _spBodyOnLoadFunctionNames.push("rewriteNavigationLinks"); function rewriteNavigationLinks() { // collecting anchors var anchorArray = document.getElementsByTagName("a"); for (var x=0; x 0) { oldUrl = anchorArray[x].outerHTML; // adding target attribute newUrl = oldUrl.replace(/#targetnewwindow/,'" target="_blank'); anchorArray[x].outerHTML = newUrl; } } } /script Then in the term store append "#targetnewwindow" on the link to activate the specific link. E.g. http://intranet.foo/somepagename.aspx?pid=000#

Configuring MySite search center settings for SharePoint 2013

I stumbled over this one the other day and I (luckily) discovered the solution by accident. When configuring MySite in SharePoint 2013 you are prompted to give up the URL for your search center. Now, if you’ve set up an Enterprise Search Center as I’ve done redirecting you to the correct result pages will fail when doing a search from MySite. Leaving you with an “The page you're looking for doesn't exist”-error. (Yes, another of MS meaningful errors). The error you’ll discover is that you’ve most likely entered something like http://theUrlFor/MySearchCenter on the MySite configuration, while it should have been http://theUrlFor/MySearchCenter/pages Problem: When searching from MySite you get “The page you're looking for doesn't exist” Reason: The search URL is wrong and SharePoint cannot find the pages that display the search results. Solution: The solution giving you least headache is to use the SharePoint PowerShell and execute the following lines: