Tuesday, October 20, 2015

This blog has moved to SharePointBabe.com

This blog is moved to Wordpress and to

You will be redirected any second :)

Sunday, September 27, 2015

I have deactivated my Facebook account...

First I would like to thank the people who liked my SharePointBabe Facebook page! But I have decided to leave Facebook on which I have had an account since 2008, because I think it has turned into a real spam place and it feels like such a waste of valuable life time to scroll through the endless noise that is on the facebook news wall. And I must say, it feels like I've left a cult or something :) I have really thought long about this decision, do I dare to leave the biggest social area online and will I loose contact with my friends if I leave?? Will other people think I am weird if I leave, and will I be left out of Events and Groups and what someone ate the other day or if their cat did a cute thing? And I thought that I can really live without all that noise! The only thing that is hard to separate from is Messenger. That is just a brilliant app! But of course you must be a Facebook user (at least yet, in other countries you can add your mobile number and use it) and that is so sad, because I used that app a LOT. So why not just use Messenger you might think, well the thing is that if you go in there you will also visit Facebook at the same time, it just works like that. So I made the choice to sacrifice Messenger, buhuu :)

How do I keep in contact with my friends now then? Well, I think that 50% of my "friends" on Facebook are "connections" like on LinkedIn. That means, that I don't really hang out with these people like I do with my friends, they are more acquaintances like old collegues, someone I met in a bar, someone in the SharePoint business, and these people I have on other social media like Twitter, Instagram and LinkedIn so I will still have them somewhere in my life. Which is good, my point with leaving Facebook is not to loose my friends or connections!! It is to get out of the constant scrolling of the Facebook news feed that doesn't give me any satisfaction! I'd rather scroll Twitter where there actually are real news and interesting users and hashtags that I can follow. On Facebook I have to scroll through all other peoples hobbies or activities, of which I might have no interest. On Twitter I can choose what I want to follow, and it's just so easy to click Follow or Unfollow - you will not offend anyone by unfollowing people (like when you unfriend on Facebook, that is a total different thing...) and you don't have to confirm if someone wants to follow you. So simple and brilliant.

But I started with small steps, I must admit, I did not DELETE my Facebook account, I only DEACTIVCATED :) Cult, like I said, a bit brainwashed thinking that I might loose a whole part of my personality or life if I leave... ;) So who knows when I can take the next step? Maybe I will regret this and crawl back with the tail between my legs and give in to Facebook later but right now it just feels good. I think I have saved at least 1,5 hours just today by not having Facebook! Something to think about. Instead, I took a long powerwalk, listening to an interesting podcast that talks about something that I like and that was a better invested 1,5 hours for me.

So, if you want to follow me now, and I hope you want to, just type in @SharePointBabe on Twitter or Instagram instead and click on Follow. Or subscribe to my YouTube channel, I will post more there shortly. And of course, you can follow me on this blog (and I was about to write Google+ but I actually don't know if anyone uses that?).

Best regards from a happy SharePointBabe who still loves social media :)

Friday, September 25, 2015

NAPA dev tool on Office 365

Create Office Add-ins/SharePoint Add-ins (it's not called Apps anymore) by using Napa with an Office 365 Developer Site

This is a cool tool, and easy for us who hasn't a developer background. It's very straight forward.

To get started, you need the proper O365 license, for example I have the E3. You need to have any of these:
Office 365 Midsize Business
Office 365 Enterprise E1, E3, E4, or K1
Office 365 Education A2, A3, or A4
Office 365 Government G1, G3, G4, or K1

Then open the Office365 Admin center and create a new Private Site collection using the template "Development Site".

Wait for your Developer Site to finish setting up. After provisioning is complete, refresh the admin center page in your browser and there will be a link to the site or just open the URL you just created. You should see a site that contains the "Get Started" web part with buttons to "Build an app" "Publish" and "Samples":



(I added this site to the Tiles, to have quick access to it. See how you can do that here.)



Click on the "Build an app" icon and select what type of App, sorry Add-in, you want to create and give it a name.



Click OK and you are in code mode :)


The left side task bar contains buttons for Run, Retract, Open in VS, Share, Publish and Quick Open (if you need to search in the project)

The code editor of course has intellisense, and you can right click! Not so common when it comes to SharePoint sites! You can right click to create new files, upload files, etc. Sweet.


For me, as a non .NET developer, this tool is very useful because even I could quickly build a small app that displays all pictures tagged with "sharepointbabe" from Instagram. Cool right? Not many lines of code to get that. And then you can put CSS on it to make it look nicer, and so many more things to make it look good. And make it a web part so the user can add their own values.

I will try to import my blog posts from this blog now. 

To Publish, you have to create an App Catalog site first in the O365 Admin center:


Next step:

But I am missing something: the option to build InfoPath apps, add-ins, but I don't think it is supported which is sad. It supports the common Office family of course like Excel, Word, PPT, Outlook, you can build task panes and contents and mail forms. You think you have found a perfect way to do something and it is like 90% satisfaction, but the last bit missing. Maybe it's because Microsoft had planned to stop supporting InfoPath (and then changed their minds), but I think a LOT of companies uses InfoPath. And it is a brilliant, from-easy-to-super-complex, software, I love it! As you can tell from my many post blogs about InfoPath :) But it's just so smart with the Rules, you can add code, lookup info from SharePoint lists or other media, and you can design it to look really good. And you can import/export data. I mean, how useful isn't InfoPath!! I have a few forms that I would like to package as add-ins but maybe I am thinking wrong, maybe that should be done in another way rather than from the app store. But for me, it would make most sense. 

Anyway, this tool is probably super old for many of you, and I have not had the need to use any development tool like this before but it's never too late to change! :)

Sunday, August 30, 2015

Thoughts on branding in Office 365/SharePoint

Sometimes I wish that there was just one way to brand SharePoint and it would be fast and easy. Well I can dream on, right? There are so many ways to do this, and I have tried to sort out what the best way would be to brand a site with least amount of work and to avoid user interaction on new sites. You who have branded sites using Master Pages knows what I am talking about: yes, you create a fancy looking master page and add a css file but when the user goes ahead and create a new Team Site - boom it's back to the baby blue interface. And for some users this is way too complicated to learn how to enable the publishing features. And yes I know I can code this like a feature, but I don't know if people do that anymore? Anyway, Microsoft has now decided that they do not recommend using custom master pages in Office 365 because then you can miss out on new features. So I thought: what alternatives do I have to add custom branding then? Because every customer wants that, to take away the "SharePoint look".

To clarify: I am looking at this from a no code perspective, and with code I mean .NET or JavaScript or any other code language for doing this. Office 365 is used as an example here, but most of it should be doable in SP prem also.

There are so many options in SharePoint, but many of them leads to the same things. You have:

- Design Manager
- Master Page
- Alternate CSS
- Themes/Composed looks/Change the look
- Custom theme in Office 365 Admin
- Then of course all the tools that you can use like SPD, html software, SharePoint Color Palette etc

I mean.... it's all too much. And I don't want my users to be able to change any theme or need to enable features. Here is a short description and pro/cons of each method, and these are just my personal opinions! Please feel free to add more or let me know if I am wrong/right about these methods :)

Design Manager

This is just an entry for the branding options. Here you can upload the custom master page, add custom page layouts, import design themes, change the theme and colors, edit display templates, pick a pre-installed look and create your own design package.


Custom Master Pages/Alternate CSS

This has always been my favorite, because they are so easy and powerful. And I have branded a lot of sites by just adding my own custom css file to the master page and overriding existing classes or create my own. This has worked so fine, also in upgrades with a little bit of refreshing. Well since Microsoft has decided to not support this in the cloud in future, I have to skip this now. Only downside to using this is if you allow your users to create new sites, then you have to teach them how to enable the Publishing feature.

Pros: Fast, easy, powerful, no risk of being overwritten in upgrade (if you do it right), upgradable
Cons: Publishing feature needed, not supported/recommended in O365


Themes/Composed Look/Change the look 

These alternatives belongs together if you want to create your own custom theme. When you create a .spcolor file using the SharePoint Color Palette tool, you upload the files into the 15-folder in Themes.

After you have uploaded your theme files you go into Composed Look to create the new Theme template. Add the url to the spcolor file and name it.


After the theme files are uploaded, the theme is created you will find your own custom theme in the "Change the look" or in "Design Manager". Always several roads into the same target :)



Pros: Easy to setup but maybe not so fast due to so many classes to put your branding on
Cons: Will not be applied to Team sites... And even if the user can click on "Change the look" your custom theme will not show up here unless you enable the publishing feature.


Custom themes in O365 Admin

There is a branding option in the Office365 Admin pages, that might actually be enough for many companies out there. You may add your own header picture, and that will be applied to Delve, OneDrive, etc which is very nice. You can add your own logo and make it a hyperlink. Then you can set it to not allow users to override the theme, which is also good.
Very simple, just do this:
Open Admin in Office 365
Click on "Company Profile"
Click on "Custom theming"
Make your changes, the only annoying part is to use a picture that is smaller than 15 KB and still make it look nice. But I used a desert picture, good for repeating patterns :)


Pros: super easy, will be applied to all sites, users cannot override if you set it like that, sure it will be supported in future, this might be enough "branding" actually for many companies that don't want to put too much money and time on branding a site. This does not require any activation of any features.
Cons: only applies to the header part of a site, not any content pages, I think there will be more things added here further on but right now it is quite limited.

Conclusion

There is no really easy way to go around the fact that you need to have the Publishing Feature enabled on a Team Site to get your custom branding. If you have control of the site creation, then it is no big problem, but if you want to let the users create sites like in a project portal, then you must teach them to go in and apply the Master Page to all subsites now and then, or when they create the site. Because I have tried to create templates from a branded site and that will not work either, unless you code a feature and I don't even know if that is supported anylonger?

I googled and found a cool tip from Sonja Madsen on how to do a trick and save a site template with a custom master page, but unfortunately this did not work, at least not for me. I ended up with the OOB look anyway, and if I looked at what master page it chose I could see that the site was set to inherit, as she writes in the article, but the custom master was still not applied :(

So I don't know, maybe I will still use the master pages and take the pain and the potential loss of new features but if you keep an eye on what is new in Office 365 I think this is the best and most powerful way to brand a site.

Please let me hear what you think or how you usually brand SharePoint, and prove me wrong ;)

Tuesday, July 28, 2015

How to create cascading dropdown boxes in InfoPath

Learn how to use SharePoint lists as data connections in InfoPath and how to use that as cascading drop down lists in InfoPath. Often when I build forms I find it very useful to have SharePoint lists as lookup information, both because it is easy to setup and also the users can change the information without having to design the form in InfoPath and also because it is the easiest way to create cascading drop down list boxes. This video shows how to achieve this. Thanks for watching!


Tuesday, July 21, 2015

QuickTip: Add a custom tile to the App Launcher

This is very useful since I have missed a link to the Intranet site on the App launcher, since I started using Office365. Now you can add your own links and apps to the App launcher.

You need to have access to the "Admin" menu in Office 365 to do this
Make sure you have your intranet logo ready, maybe upload it into the Site Collection Images and then copy the URL
Go to the "Admin" in the App launcher
Click on "Company Profile" and then on "Custom tiles" and the + sign


All fields are mandatory, and fill in accordingly
Paste the URL to your intranet logo picture

Now this tile ends up in the "My apps" in the App launcher


But I want it also in the App launcher, so hover your new tile and click on the 3 dots
Select "Pin to App launcher"
And now there is a direct link to your intranet. Very nice!





Tuesday, July 14, 2015

Connect InfoPath to the AD

This is an instruction on how to connect an InfoPath form with the user profile web service to query the AD and get user information into the form using Claims authentication. Applies to SharePoint 2013.


Tuesday, July 7, 2015

Upload videos from your iPhone and Spotlight videos in Office365

The first time I tried to upload a video from my iPhone 6 into the Office365 video portal, it failed. But I tried again and this time it worked. You can add a Title and a description on the video before you upload it, and then it takes quite some time to upload just a small video on about 2 minutes. At least it worked this time, and the video is available on my portal.

It would be nice if you could decide what thumbnail you wanted to display the video with.

I have used the Spotlight feature, where you can choose which videos to display on your channel.
Go to the Video portal, and click on Portal Settings up in the right top corner
Click on "Spotlight" and select what videos you want in the spotlight areas.

One question though... how do I remove a video from the spotlight area???



Then go to the video portal again, and find the videos up in the banner of the Home page




Saturday, July 4, 2015

QuickTip: Embed a video from Office Video on a page

It's a new feature in Office Video (for #Office365 licenses) that you can now embed one of the uploaded videos on a page. Which is great! You can also control the size in the code.

Go to your Office Video portal
Click on the video you want to embed
Click on "Embed" up in the right corner


Then copy the code inside the box


Then go back to your site, Edit the page and select "Embed code" up in the ribbon



Paste the code and make any changes
Save the page and your video is on a page :)
Now I just want to be able to select which thumbnail the video should display!




Wednesday, July 1, 2015

Video on how to Display Comments and Likes in a News Web Part

So there has been questions and problems on how to setup and configure the Content Query Web Part so that it shows news with rollup images, likes and comments. Therefore I decided to make a video and show all the steps. You also find the file package up in the menu, there is a link called "NewsWebPart".

If you like my videos, please subscribe to my YouTube channel, there will be more videos soon!
Thanks for watching :)


Friday, June 19, 2015

About the SPBiz Online Conference concept

Just a quick word about the concept of the 2 day conference I just attended, the SPBiz hosted by Collaboris.

Online conferencing is great for so many reasons: no travel and hotel costs, the conference sessions started after work hours so you could enjoy it the entire evening (at least in my time zone), it's good for the environment and the platform they had built for the conference was great! You had a list of all sessions and could just "Add to plan" and they were rolled up on the "My sessions" page. Easy to get an overview on what sessions you wanted to follow AND you can watch or jump several sessions at the same time. And later on, you can see the sessions again since they will be OnDemand.

Of course there are always tech problems with some lagging, audio out of sync, some users had browser problems etc, but I did not have so much of that so I think my Surface Pro and Chrome worked perfect for this!

The guys at Collaboris are amazing to work with, I did that when I was working with their product DocRead - which is one of the best 3rd party product I've come across. Easy to install, easy to setup, easy for the users to understand and it rarely fails. If it does, you have the best support from Mark and Hugo at Collaboris. Always quick to help and come up with new solutions! Like for instance, when I used replication software and it accidently deactivated the Site Collection Feature for DocRead which caused all records to be deleted, (we could restore so no bigger problem but anyway), but they changed that feature later so if it gets deactivated nothing will be removed in the system so no worries about that anymore. So, again, great support and great team there.

Another great thing is that you can lay on the couch, or enjoy a glass of wine at my bar and watch all sessions J

Wednesday, April 29, 2015

QuickTip: Display multiple values based on selection in InfoPath

I have a form with a selection box where the user selects a Role, and based on that Role I set a multiselect field with the predefined values, in this case Applications. What I wanted to do, was to have the checkboxes selected by default OR not display the checkboxes at all. Because this should be a list of all applications that are included when you select a specific role, so the user should not be able to check or uncheck any boxes. I select a role in the left drop down box, and all the values are shown to the right in a Multiselect box:


It does not seem possible to have all values selected in the Multiselect field, only the top value can be selected and that is not what I want. It's either ALL values or NO checkboxes. Well simple enough I chose the "ListBox" instead, that rolls up all values without checkboxes. The only downside is that you can select one or more values but I have not published the values in the fields anywhere and I am not saving them so it is fine. So the left drop down box selects a role and the listbox shows all values separated by a new line:




Display comments and likes in CQWP

This is an update from my former blog post about showing likes and comments in a news web part. And I also get questions about how I have done this, and people saying that they never managed to do the same. So even if I updated the former blog post with this solution, it may not have been clear enough how I did it.

First of all, I changed from using the CSWP (Content Search Web Part) to use the CQWP (Content Query Web Part) as I never got the Comments to work without always running a Full crawl (and we don't want that!).

Then I create the news on a separate Blog site. The news will then be rolled up on the intranet front page in the following format:


As shown in the picture above, the news item is rolled up displaying Published Date, Title, Likes and Comments. Sometimes I also add the Category, but that part is easy and if you can add one you can add another of these fields, so I will mostly focus on how I did the Like and Comments part.

To modify the CQWP you must first add your own xsl files.
NOTE: do NOT modify the existing files - they might get overwritten in an update OR you might write something totally wrong and nothing will work on your site. You always create a new folder called "Custom" (or whatever you want), then you COPY existing files and paste them into your folder and there you can modify them without taking a risk.

Easiest is to open your site in SharePoint Designer, browse to the folder Style Library > XSL Style sheets > Create your own folder "Custom". Then copy the file called "ItemStyle.xsl" and paste into this new folder.


Now go to the site where you first add the CQWP and then export that same web part. You export a web part by clicking the arrow on the web part and then select "Export":


Open the file, it might be called "News.webpart" or whatever you named the web part, and find the row with the property name "ItemXslLink" and change the path to the new that was created above:

Tag: property name="ItemXslLink" type="string"
New value: /Style Library/XSL Style Sheets/Custom/ItemStyle.xsl

It should look like this in the webpart file now:


Then add the fields that should be displayed in the web part, they need to be added in a special way and you must find out their GUID. Find the property tag called "DataMappingViewFields" and the fields must be added in this syntax: {GUID}, Type and then separated with ;


To find the GUID of the fields that should be displayed, go to the list where the columns are and hover each column or click on it and look in the address field. The URL will contain the GUID. Be sure to remove the ASCII for % and - since they are in the URL.
Example:
I want to get the field where Comments are, (which is a Lookup Field) so I go to my news blog and open the Posts list. Go to the List settings and scroll down to find the Column field. Click on it and copy the URL and then paste that into Notepad. You will get something like this:


Then in Notepad, copy only the GUID from the URL:

%7B6026020B%2D0EB4%2D42D0%2DAA51%2D2BBA3A3CD9DF%7D

And then replace all ascii characters with the normal character like

%7B which is {
%7D which is }
%2D which is -
and you will get

{6026020B-0EB4-42D0-AA51-2BBA3A3CD9DF}

Do this for all fields that you want to display in the web part, like Comments, Likes, Category etc

Before you upload the web part file, go back to SharePoint Designer and open the custom xsl file. Add a new xsl:template in the file like this (it is an image):



The entire code in this is here, but the < tags are exchanged to [] so that the code can be displayed here on the page (just replace the [] with the regular < tags):

[?xml version="1.0" encoding="utf-8" ?]

[xsl:stylesheet
  version="1.0"
  exclude-result-prefixes="x d xsl msxsl cmswrt"
  xmlns:x="http://www.w3.org/2001/XMLSchema"
  xmlns:d="http://schemas.microsoft.com/sharepoint/dsp"
  xmlns:cmswrt="http://schemas.microsoft.com/WebParts/v3/Publishing/runtime"
    xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt"]
[xsl:param name="ItemsHaveStreams"]
    [xsl:value-of select="'False'" /]
  [/xsl:param]
[xsl:variable name="OnClickTargetAttribute" select="string('javascript:this.target="_blank"')" /]
[xsl:variable name="ImageWidth" /]
[xsl:variable name="ImageHeight" /]

[xsl:template name="BigImage" match="Row[@Style='BigImage']" mode="itemstyle"]
[xsl:variable name="SafeImageUrl"]
            [xsl:call-template name="OuterTemplate.GetSafeStaticUrl"]
                [xsl:with-param name="UrlColumnName" select="'ImageUrl'"/]
            [/xsl:call-template]
        [/xsl:variable]
[xsl:variable name="SafeLinkUrl"]
            [xsl:call-template name="OuterTemplate.GetSafeLink"]
                [xsl:with-param name="UrlColumnName" select="'LinkUrl'"/]
            [/xsl:call-template]
        [/xsl:variable]
[xsl:variable name="DisplayTitle"]
            [xsl:call-template name="OuterTemplate.GetTitle"]
                [xsl:with-param name="Title" select="@Title"/]
                [xsl:with-param name="UrlColumnName" select="'LinkUrl'"/]
            [/xsl:call-template]
        [/xsl:variable]      
     
[div id="Item_LargePicture" style="padding-bottom:10px"]

        [div class="cbs-largePictureContainer" id="_#= containerId =#_" data-displaytemplate="ItemLargePicture"]
            [div class="cbs-largePictureImageContainer" id="_#= pictureContainerId =#_"]
                [xsl:if test="string-length($SafeImageUrl) = 0"]
[a href="{$SafeLinkUrl}"]
[img src="/_layouts/15/images/custom/emptynews.png" class="cbs-pictureImgLink" /]
[/a]
[/xsl:if]
[xsl:if test="string-length($SafeImageUrl) != 0"]
[a href="{$SafeLinkUrl}" class="cbs-pictureImgLink" ]
[xsl:if test="$ItemsHaveStreams = 'True'"]
[xsl:attribute name="onclick"]
                          [xsl:value-of select="@OnClickForWebRendering"/]
                        [/xsl:attribute]
[/xsl:if]
[xsl:if test="$ItemsHaveStreams != 'True' and @OpenInNewWindow = 'True'"]
[xsl:attribute name="onclick"]
                        [xsl:value-of disable-output-escaping="yes" select="$OnClickTargetAttribute"/]
                        [/xsl:attribute]
[/xsl:if]
[img src="{$SafeImageUrl}?RenditionID=5" title="{@ImageUrlAltText}" class="cbs-pictureImgLink" id=""/]
[/a]
[/xsl:if]

            [/div]
                     
            [div class="cbs-largePictureDataOverlay"  id="_#= dataContainerOverlayId =#_"][/div]
            [div class="cbs-largePictureDataContainer" id="_#= dataContainerId =#_"]
             
                [a class="cbs-largePictureLine1Link"]

[h2 class="cbs-largePictureLine1"]

[a href="{$SafeLinkUrl}" title="{@LinkToolTip}" class="cbs-largePictureLine1Link"]
[xsl:if test="$ItemsHaveStreams = 'True'"]
[xsl:attribute name="onclick"]
                  [xsl:value-of select="@OnClickForWebRendering"/]
                    [/xsl:attribute]
[/xsl:if]
[xsl:if test="$ItemsHaveStreams != 'True' and @OpenInNewWindow = 'True'"]
[xsl:attribute name="onclick"]
                      [xsl:value-of disable-output-escaping="yes" select="$OnClickTargetAttribute"/]
                    [/xsl:attribute]
[/xsl:if]
[xsl:value-of select="$DisplayTitle"/]
[/a][/h2]

[/a]
           
                [span title="_#= $htmlEncode(line4) =#_" id="_#= line4Id =#_" ]
                [xsl:value-of select="ddwrt:FormatDateTime(string(@PublishedDate) ,1053 ,'dd MMMM')"/][br /]
                [xsl:value-of select="@PostCategory"/][/span]
                [span title="_#= $htmlEncode(line5) =#_" id="_#= line5Id =#_"]
                [span style="padding-left:180px;"][xsl:if test="string-length(@LikesCount) = 0"] 0[/xsl:if]
[xsl:value-of select="@LikesCount" /][span style="padding-left:3px;vertical-align:text-bottom"][img src="/_layouts/15/images/custom/like.png" border="0" /][/span][/span][span style="padding-left:10px;"][xsl:value-of select="@NumComments" /][span style="padding-left:3px;vertical-align:text-bottom"][img src="/_layouts/15/images/custom/comment.png" border="0" /][/span]
[/span]
[/span]            

            [/div]
        [/div]
    [/div]      

[/xsl:template]
[/xsl:stylesheet]


Okey so now we have a style for the news items. But there still are some things more to do.

Enable Image Rendition and Blob Cache to make the images render in the correct size, like thumbnails.

First upload this new web part into the sites WebParts gallery (its better to do that than to just upload it straight into the page, and you can also give it a proper name and put it in its own folder so its visible in the gallery when you add a new web part)

Then go to the start page and add this new web part. You have to modify it to point out the news blog location, and to select the correct display for it. And to make other settings that you need, like how many items that should be shown, what sorting order you want, if you want to add any filters etc.

In the web part settings, also go down to the section where the fields are mapped. Then add the names of the columns that you want to display, like PublishedDate, Category, Likes etc and you will find that there are new placeholders for these as we added those in the webpart file:


Yes it is in Swedish, but if you are familiar with CQWP (which I really hope you are, since this is quite complex to setup) then you should recognize the fields I am talking about. So, type in the name of the fields you want to display and DONE. But what? No, you cannot find a field for Comments? How surprising ;) This is where we need to go to Central Administration on the server and a new Mapping property in the Search app.

Go to Central Admin, open the Search service app, click on the link "Search schema" in the left menu and there add a "New managed property":



Call it what you want, like "NumberOfComments". Then set it to be Searchable, Retrievable, and then scroll down to the mapping. Add a new mapping and find the field called "ows_NumComments" and then Save this. You MUST run a full crawl for this to apply.



Okey, that was it. Simple right?? :) :)

Tuesday, April 28, 2015

QuickTip: Enable Anonymous access in SharePoint 2013

When you want to publish a SharePoint site as a public website, you must enable anonymous access - otherwise the user will be prompted with a login. Note: This is for on premises servers and not the cloud/Office365.

Open Central Administration on your server. Go to the Application Management section and then click the “Manage web applications” link.

Select the web application where you have your public web site collection and then click the “Authentication providers” button available in the Ribbon. It will most likely show a "Default" link:



Click on the “Default” and then check the “Enable anonymous access” option and then Save.



Now open the site collection that will be used as public website and go to the Site Settings. Click on "People and Groups". In the ribbon there is a button for “Anonymous Access” that allows you to configure how anonymous users can access to the site.


Click the “Anonymous Access” button in the Ribbon and find three options, select the one that is suitable for your site. In this case I would check the "Entire Web Site" to give the users full anonymous access to the site.



Now when you go back to the “People and Groups” page, there should be a new group called “Anonymous users” available in the list and it shows what permission they have on the site.

To test the anonymous web site, make sure you are signed out of the browser you are testing in, and see if you can access the site withouth having to sign in.

 

Friday, March 27, 2015

Site Collection Administration permission lost - strange issue

Strange thing that happened to my account. I am Site Coll Admin on all web sites on an on prem server, but one day the "Site Collection Administrators" and "Site Collection Features" links were gone from two of the sites (in Swedish):





First thing I checked is in Central Administration and "Change Site Collection Administrators"
I was listed on all sites

Then I logged in as the farm administrator and could access the "Site Collection Administrator" link. One site was empty of accounts and the other had only one other account listed. Strange, since I have never changed these values.
I simply added back the accounts and on one of the sites it worked fine. But, on the other I got this message when I tried to add back my own account:

Parametern loginName får inte vara tom eller längre än 251 tecken
Translated:  The parameter loginName cannot be empty or bigger than 251 characters

Very strange, I have never seen this error before. But this made me remember that when I tried to add one of our AD groups, I got a message that the name was too long. So there is a limit on how long account or group names you can use in SharePoint. Somehow these entries must have been removed - in an update? Or when I ran the powershell command that clears the logon cache? I have no idea.

I tried a few times more, and then boom - the accounts just went through and now all three accounts were added.

I have no code running on the sites, the only customization is in my master page but no big at all. I have not made any changes in the web.config files on these two sites.

The only change I can think of is that the ASP.NET feature was installed by another administrator on the server, we will remove it again because it generates other errors in Event Viewer. Maybe something happened when that was installed.

Any ideas?




Change favicon in SharePoint 2013

This is a quick fix!
To change the icon that is displayed on the bookmark in a browser from the:

To something more sexy, then do the following:

Create a new folder in this location C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\IMAGES
I named mine "Custom". This is always best practice, so that your changes wont be overwritten in any update.
Paste your new favicon file, dont forget to rename the file extension to .ico

Open your html version of the master page (if you have a custom)
Change the location inside the tag 



Thursday, March 26, 2015

The Current server is running low on memory

There is an error reported in Health Analyzer on my SharePoint 2013 server regarding the Distributed Cache "current server is running low on memory".
 
So, the Distributed cache uses 10% of the  total physical memory on the server. The Distributed Cache service uses half of that memory allocation for data storage (also known as cache size), and the other half of that memory allocation is used for memory management overhead. When the cached data grows, the Distributed Cache service uses the entire 10 percent of the allocated memory.  (Source: technet)
To check the existing memory allocation, run this command
Use-CacheCluster
Get-AFCacheHostConfiguration -ComputerName ComputerName -CachePort "22233"
 
There is 16 GB RAM on this server, so 819 MB is not enough. First stop the Distributed Cache Service in Services on server in CA
I first tried to update the size to what Technet recommended (7168 MB) but then I could not start the service again since I did not have enough free memory:
 
Instead, I updated the size to the double at 1600MB with this powershell cmd:
Update-SPDistributedCacheSize -CacheSizeInMB 1600
Then started the Distributed Cache service and the message in Health Analyzer disappeared.
 

SOLVED: "Open with explorer" disabled in IE11

[SOLUTION]
I found that this button was disabled because of this line in my Master Page - I am using Bootstrap theme from Codeplex and that comes with its own master page.
What I had to do was change this line in the header from:
 to (taken from Seattle master page)
And now, the button is enabled and working!
 
[PROBLEM]
I have an issue with Internet Explorer 11 and SharePoint 2013. The option "Open with explorer" is disabled, it works in IE10 but not IE11:


I have tried all possible solutions:
- added the site to Compatibility View settings
- added the site in Local intranet
- checked the add-ons
- checked that the local service WebClient was started
- I am running the 32-bit version
- the kb 2846960 is installed (http://support.microsoft.com/kb/2846960)
And obviously it is working in Internet Explorer 10. Maybe there is a new hotfix or something that needs to be installed, have googled this but not found any proper solution yet.

Tasks and Timeline disabled with bootstrap in IE11

This problem ONLY concerns IE11 and on a SharePoint site using the bootstrap theme. When you create a Team Site and add a Task list, the ribbon is disabled and either the Tasks nor the Timeline is visible. If you open the same site in IE10 or Chrome, it is visible and working.

The site is added into the Compatibility View Settings and if I apply the Default Theme then it all works so it must be something in the bootstrap CSS files or JS that is blocking.

 

Display Comments and Likes in content search webpart

[SOLVED] Instead of relaying on the search crawler for the #Comments field, I simply added the following line in the Display Template and that works with continous crawling:
_#= ctx.CurrentItem.NumComments =#_
[/SOLVED]
 
I want to show both number of Likes and Comments in the News webpart, which I have built using Content Search and my own custom Display Template.

 
The Likes is easy, it already exists. Just select “LikesCount” in the Property Mappings List (Note: I have added own lines in the display template, hence the extra rows below):

The number of comments are not included though, so that property needs to be created in the Search Schema. In SharePoint 2010 and in a Content Query Web Part, I referred to this field with #Comments. But that does not work in 2013.

Go to Search Application on CA, and to Search Schema. Add a new Managed Property, I called it just “NumComments” and map it to the column “ows_NumComments”. Configure it like this:
In the display template, I have used Glyphicons to display a Like button and a Comment button. This is my code for the “Like and comment” part of the news (I have removed the <> from code and replaced with [] ):

[div class="cbs-largePictureLineCustom ms-noWrap"]
[span title="_#= $htmlEncode(line4) =#_" id="_#= line4Id =#_"]_#= likesCount =#_  [/span]
[span class="glyphicon glyphicon-thumbs-up"][/span]
[span title="_#= $htmlEncode(line5) =#_" id="_#= line5Id =#_"]_#= line5 =#_ [/span span class="glyphicon glyphicon-comment"][/span]
[/div]

When running continuous crawling, the Likes showed up within a 3 minute interval (I have set that interval using Powershell cmdlet Get-SPEnterpriseSearchServiceApplication and continouscrawl), but the Comments never showed up unless I was doing a Full Crawl.
So to enable the number of comments in the continuous crawl, click on the “ows_NumComments” link that is displayed in the Search Schema:

And deselect the “Include in full-text index” (this turns out to not help anyway which you will find out below):

But the Comments still did not show up in the web part, (unless I did a Full Crawl).
So I did a Reset Index. Ran a Full Crawl, to make sure that my changes above had been implemented. Still new comments are not displayed unless I run a Full Crawl.
Looked in the Search Schema again, but this time I clicked on Crawled Properties. Found a difference between the field ows_Comments and ows_LikesCount. The later had a mapping, which ows_Comments missed. So I added the following mapping into the "ows_NumComments":

Started a Full Crawl again to implement the changes.
Added a new comment and waited for the continuous crawl/incremental crawl to pick up the changes, but it does not show in the content search web part. Only when I do a full crawl. Don’t know if it has to do with the NumComments field being a Lookup field? If you look at the column properties on the blog site (the News are built on a blog site template) then this is all the info you get:

The column is not created as a Site Column, but a local in the Posts library of a blog site.  The only solution I could think of, and I don’t like it but what to do, is to create a new Content Source with only the link to the comments in it and set that to Full Crawl each 3 minutes. Don’t know if this will work in the long run, but for now it’s good enough.

 

Hide Conversations from Search

If you want to hide the “Conversations” options from the dropdown menu that is shown after the Search box, the easiest way is to CSS hide it. Set the following class to “display:none”.
#ctl00_PlaceHolderSearchArea_SmallSearchInputBox1_csr_NavDropdownList div:nth-child(3){display:none;}
 
Then you want to remove the same option from the Search center page (results.aspx) also.
Edit the Search page (in the Search center)
Edit the Search Navigation web part
Click on “Search Settings Page”
Select “Conversations” and “Delete”

Done.