Add Custom Search to a Sharepoint Online 2013 Blog Site

Planet Microsoft.
Sometimes I think Microsoft must be living on a different planet. They provide a useful blog site template with a lot of built in functionality and enough flexibility to allow it to be used in a variety of ways – not just as a blog. But the out of the box search function uses a results page located in the dreaded _layouts directory that prohibits any customization. That’s okay if you’re not customizing your blog site, but I find it hard to believe anyone would consider the dreadful out of the box blog styling acceptable for a serious enterprise intranet or public site.

Searching for the right search.

So if you customize your blog site’s look, how do you fix the search results page so it looks like it belongs to the same site and doesn’t revert to the appallingly bland default /_layouts/15/osssearchresults.aspx page?

After a lot of googling and a series of frustrating and failed attempts to play with master pages and page layouts, I hit upon a very easy solution. Instead of trying to force the site’s framework onto the search results page, insert the search into the site. Here’s how I did it:

How to

  • First I made a copy of the post.aspx page.
  • I renamed it search-results.aspx. (You can either delete or hide the default web parts on the page).
  • I opened the page in edit mode and inserted a search results web part.
  • I then opened the site settings > search > search settings.
  • And specified the page results should be sent to.

search1

 

Refine your search.
That alone connects your site’s search box to the results web part on the designated page. Which is pretty cool.It does however return everything in the site collection index – a lot of which may be irrelevant. My thinking is if someone is searching a blog they probably only want to see relevant posts in that blog. So I refined the results as follows:

Open the new search results page and edit the results web part’s properties.
Click change query.
Change the “select a query”, “restrict by app” and “restrict by content type” settings according to the image below.

search3

That will only return relevant posts. Of course you can vary that schema depending on your own desired results. And the end”result” is this – regular post page on the left and search results page on the right:

search4

 

So there you go – a quick and easy way to use built in functionality to do what Microsoft should have already done for you! Hard to believe how simple this really is – and harder to believe why Msft doesn’t do a better job of documenting simple answers like this to common questions.

Questions?

Visit my forum » if you have any questions. For development work, you can contact me here ». And if you think this would be useful to others, feel free to share it by clicking one of the share buttons up top!

Add scripts/iframes to Sharepoint 2013 blog posts.

If you add code for an iframe or a script to a Sharepoint blog post, you’ll be greeted with an annoying alert that warns you that: “some of your html may have been modified”. In effect, filters in the text editor strip out your code as a result of one of Microsoft’s odder design decisions: to allow iframe and script codes in a page but strip them out from the rich text “body” field in their blog post template. This inconsistency is annoying andnot getting any attention from Microsoft, so we need to workaround it.One option to get around this odd restriction is to add another field to the post list view web part that will dodge the rich text field filters, and render iframes and scripts right below the body field. This article will show you how to do that in 4 steps:

1/ Add an html field to the post list
2/ Rig it so it renders as html not text
3/ Add the field to the list’s views
4/ Add a simple script via a jslink file so it shows up in the post.

Add an html field to the post list
Navigate to your blog post list’s settings and add a single line text column called”html” to the list.

Rig it so it renders as html not text
Add a calculated column with this formula:=html.
Name the field”Calc” – if you use a different name make sure you update the field name in the jslink file referenced below.
Important:SELECT “NUMBER” AS THE OUTPUT. This little trick ensures the code you enter in the html field will render as code and not plain text. Keep in mind the character limit of a single line text field is 255, so your code will have to be below that!

Add the field to the list’s views
Adding a field to the post list view and then updating the view on the post.aspx page will break the connections and scripts that make the blog work. So you will have to open the post.aspx page in Sharepoint Designer, click into the appropriate list view web part and use the”add fields” tool in the ribbon.
MAKE SURE YOU MAKE A BACK UP COPY OF THE PAGE FIRST!

Because of a bug and Msft’s lack of quality control, the list view tools may not be visible, in which case use this trick:
Right click the list view web part.
Click”tag properties” which will open the properties dialog and then OK.

Now the tools should show up, and you can add the”Calc” field to the list view web part. You will need to repeat this for the other blog pages if you want your html to show on them: date.aspx, default.aspx, category.aspx.

NOTE: If your html field returns “undefined”, go back to post.aspx in SPD and make sure the field ref name of your field (“html”) is included in the query of the list view web part.

After editing these pages, you’ll notice the”blog tools” web part now displays an error and the page may not look right. This is another bug in SP that you can easily repair by adding the blog tools web part again and deleting the original.

Add a simple script via a jslink file so it shows up in the post.
If you’re not familiar with jslink, you can download the file below and upload it to a root library, such as site assets.

To connect it to your list view web parts, open up the web part properties and under”Miscellaneous>jslink” add the path to the file formatted with the appropriate site token. For example, for domain.sharepoint.com/siteassets/blog-html.js, use ~sitecollection/siteassets/blog-html.js. The token MUST be used for jslink to work.

Download jslink file here

Add your code
To test, edit a post and add a simple iframe code to the new”html” field. As mentioned, you cannot exceed 255 characters. I wrapped the html field in a span with a class of “post-html”, so you can adjust the styling as needed.

Questions?

Visit my forum » if you have any questions. For development work, you can contact me here ». And if you think this would be useful to others, feel free to share it by clicking one of the share buttons up top!

Microsoft Announces “Plans” To Replace Office 365 Public Web Sites

Speculation about replacement offerings for the Sharepoint Online public web site feature in Office 365 abounded after Msft announced its demise, first reported here ». Azure? Orchard? Sway?None of the above. In a very quiet update to the original kb that revealed the discontinuation of public sites, Msft has made it clear they are basically going to do nothing….well, nothing that you couldn’t do already.

They claim they are “partnering” with Wix and GoDaddy but this is a “partnership” that doesn’t benefit 365 users at all. The public site will not be integrated in anyway with O365 or come with any subscription discounts or special pricing. No data migration or site conversion will be offered that isn’t already provided by their new partners.
So basically the “partnership” claim is just a way of saving face. They are reducing the feature set of O365 with no compensatory price reduction and not subsidizing the new “service” in any way. In other words they are cutting their public site customers loose. Nice. One has to wonder if THEY are in fact getting any affiliate compensation for pushing so many customers to Wix and GoDaddy……
It’s well known Msft hasn’t been able to figure out a way to make money from hosting public web sites. And they certainly can’t be blamed for trying to refocus their resources on Office 365’s many strengths – which the public site offering couldn’t be counted among. But here was a chance to get creative, be imaginative and drum up a little customer love. Essentially they are making loyal customers pay AGAIN for their poorly thought out venture in the public site space.
Here’s that venture’s rather depressing timeline:

  • 2005-06: They initially attracted a large following by enticing small businesses with a “forever free” domain and hosting offerin the OLSB service.
  • c 2008: Realizing that was a bad decision, they started charging for domains
  • 2010-12: Next they started charging for hosting and forced customers to manually rebuild their sites in O365.
  • 2015: Now they are telling users to go elsewhere…..The fact that this announcement was buried in a kb update rather than given a little more prominence is a clear indication thet Msft knows this will not go over well. They should be ashamed of themselves…. .

Microsoft Will No Longer Offer A Public Site Option in Office 365 As Of Dec/Jan

?RIP: Office 365 Public Sites!UPDATE:You heard it here first!!
http://support2.microsoft.com/kb/3027254

“Today, we’re making a difficult decision to discontinue the SharePoint Online Public Website feature. This lets us then focus on future investments while broadening our partnership with industry leaders.”
Microsoft is throwing in the towel on the Office 365 public site option. According to a Msft source, it will be removed from the Office 365 Sharepoint Online offering as of an update scheduled for Dec 2014 / Jan 2015. Existing accounts using the public site will not be affected by this dramatic change, but can expect the already lacklustre support to dwindle further. It may be telling that the inclusion of a public site has already been removed from the feature list in the Office 365 “compare plans” pages.

The public site has long been the “runt” in Msft’s foray into cloud computing, a fact that was reflected in the option’s halfhearted functionality and support. The inability to anonymously access list items was a clear indicator from the start that balancing the needs of a functional public facing site with the need for private site security on the same server was a tricky problem to overcome. Hosting 3rd party apps on Azure was a compromise solution, but was awkward, unintuitive and unpopular with users.
Limited functionality is one thing, but Microsoft’s unwillingness to address the growing list of missing or broken public site features is an even clearer indication of their wavering commitment to the public site model. The recent rash of users complaining about problems with the public blog may have been pivotal in pushing Microsoft towards a decision to abandon the public site offering. Customers trying to create a business web site are hardly going to be reassured when support’s all too typical response to an issue is: “submit feedback”.
Learning from their early experience with the Office Live service – which ended up being almost exclusively used as a public site platform – Msft took a barebones approach to public sites in Office 365, and refocused the service on Sharepoint’s user and data management capabilities.
Savvy Sharepoint followers have long wondered about the role of a stripped down public site offering in Msft’s cloud business model. And in the face of declining use and mounting customer dissatisfaction, apparently Msft has now decided the considerable resources needed to maintain and support public sites can no longer be justified.
Questions?

Visit my forum » if you have any questions. For development work, you can contact me here ». And if you think this would be useful to others, feel free to share it by clicking one of the share buttons up top!

Retain Custom Branding For Office 365 Sharepoint Online Sub Sites (Non Publishing Sites).

?If you want to create sub sites that have the same custom design as a parent site from a template, you’ll find that non-publishing sites don’t give you that option through the browser. The master page is included in the template but an option to switch over to a different master page isn’t. The easiest workaround I’ve found is to:1/ Include elements like logo etc in the parent site master page design (using css and/or maybe a little html).
2/ Use Sharepoint Designer to designate which master page to use.

Master Your Master Page

Including collection wide elements like a logo in a master page are outside the scope of this article, and in truth, it’s pretty easy to insert a logo once you’ve built a sub site. Calling up the right master page is a bit more tricky. Basically what you need to do is make a small change to the code in each page file to call up the right master and then designate which master page that is in the master page library, using Sharepoint Designer.
Each page gives you the option to use either the “default.master” or the “custom.master”. You can associate any master page you want as the default and custom. That allows you to leave the admin pages with the standard Sharepoint look, but apply your customizations to the site pages only. Or you can use one consistent look for ALL pages. I like to designate my custom master page as the “custom” master page rather than the “default” because I think it’s clearer and sometimes customizations can interfere with the functionality of back end, admin pages, but it’s up to you.

If you want to use a custom master page:
Open the PARENT site in Sharepoint Designer
For each page you want to affect, change”default” in this line to “custom:”
<%@ Page Language=”C#”Inherits=”Microsoft.SharePoint.WebPartPages.WikiEditPage” MasterPageFile=”~masterurl/default.master” MainContentID=”PlaceHolderMain” %>

custom-master1

Now you can save the site as a template and each site created using the template will use the”custom” master for the pages you changed. One more step is needed to ensure SP grabs the right master page.
TIP» If you have a lot of pages, and don’t want to make this change in all of them, you can leave the master used as “default.master” and set your custom master as “default” in the below step.

Setting The Master Page

Once the site is created, open it in SPD.
Open the”Master Pages” folder.
Locate your custom.master and right click it to open a context menu.
Select”Set as custom master page”.

custom-master2

Your new sub site should now be using your custom master page.
Questions?

Visit my forum » if you have any questions. For development work, you can contact me here ». And if you think this would be useful to others, feel free to share it by clicking one of the share buttons up top!

Sharepoint App Review: Stock Ticker Apps For Office 365 Sharepoint Online 2013 Public Sites

Though they aren’t listed as being compatible with public facing sites in the Sharepoint store, these 3 apps do appear to work fine on them. So if you want todisplay stock prices on your site, here’s a quick way to find out which might work best for you. Links to live demos are included so you can see them in action.
Stock Chart App Part From The Sharepoint Store: 5 Out Of 10

f0101471Installation: easy – add it from the SP store
Display: shows one stock in a chart covering current month
Features: none – changing the date range doesn’t seem to do anything
Usage: awkward – no option to change stock shown without editing web part properties
Get it: Sharepoint Store-search for “Stock” -it’s NOT listed under public facing web site category
Cost: $0
Live Demo »

Stock Ticker App Part From The Sharepoint Store: 8 Out Of 10

f0101471Installation: easy – add it from the SP store
Display: clean presentation of one stock in a chart covering current day
Features: users can change stock shown easily
Usage: good – option to change stock shown is a big plus
Get it: Sharepoint Store-search for “Stock” -it’s NOT listed under public facing web site category
Cost: $0
Live Demo »

Our Stock Price App Part From The Sharepoint Store: 3 Out Of 10

f0101471Installation: easy – add it from the SP store
Display: very basic – shows one stock but only symbol, name (optional) and price.
Features: none
Usage: awkward – no option to change stock shown without editing web part properties
Get it: Sharepoint Store-search for “Stock” -it’s NOT listed under public facing web site category
Cost: $0
Live Demo »

Questions?

Visit my forum » if you have any questions. For development work, you can contact me here ». And if you think this would be useful to others, feel free to share it by clicking one of the share buttons up top!

Reactivating A Dormant Office Pro Plus 2010 Subscription

If you’ve downloaded Office Pro Plus to a computer that doesn’t get used for a while, or the id used to validate the subscription is no longer valid, eventually the programs will start showing an “unlicensed” notice and stop working fully. Downloads are associated to a user but just signing in with an id that has a valid subscription may not work. This is a common enough scenario, but Microsoft doesn’t makefinding a solution that easy.The solution (as often happens) was provided by Google – but only aftera user had done several searches and wasted a considerable amount of time asking questions on the 365 community. Buried deep within the support.microsoft.com site is a kb article with a Fixit, that reverifies your subscription and even allows you to switch it to a different id.So if you want to reactivate an Office Pro Plus 2010 subscription, click the Fixit button below, install and run it and after the usual lengthy configuration process typical of Microsoft products – eventually, it will ask you to sign in to verify. I did restart the computer before signing in, but I don’t think that’s necessary.

And here’s the kb article »

Questions?

Visit my forum » if you have any questions. For development work, you can contact me here ». And if you think this would be useful to others, feel free to share it by clicking one of the share buttons up top!

Access OneDrive (Consumer) – Or Any Hosted Location With Windows Explorer

Microsoft evidently missed the obvious irony when they decided to reuse the “OneDrive” name for the revamped Office 365 mysite document library – OneDrive For Business – thereby giving the world:
Not ONE but TWO…. ONE Drives!

Despite their confusingly similar names, the original, consumer OneDrive and Office 365’s OneDrive For Business are very different animals. Users familar with the consumer OneDrive are befuddled by the complexity and difficulties they encounter when trying to use ODFB. I guess Microsoft was trying to leverage the popularity of the “OneDrive” brand – but that popularity is based on OneDrive being “born in the cloud”, and simple and intuitive to use. The other, troubled OneDrive (ForBusiness) looks more like a botched attempt to marry the convenience of cloud access to the complexity of a server born service like Sharepoint.
A Different Approach

For those seeking the simplicity of OneDrive and some of the functionality of ODFB, it’s worth considering a different approach:
Rather than trying to get ODFB to behave like OneDrive, get OneDrive to function more like ODFB.
One way to do that is to create an access point for your consumer OneDrive storage space in Windows Explorer. That will allow you to easily drag files directly from a device like a digital camera, transfer things from OneDrive to an Office 365 library or an ftp account etc without the hassle of downloading and uploading. In effect, it makes OneDrive an extension of your local hard drive – without the risk of a hard drive failure. It also makes a OneDrive account available to other users who can access your network.

To Sync Or Swim….

Microsoft does offer a OneDrive sync client you can use, but if you don’t want to take up local real estate with duplicate file copies or deal with syncing issues, you can add OneDrive as a network place/location. It will appear just like any other folder in Windows Explorer and can be used the same way.

How To Get The Right Url.

The trick is figuring out HOW to add a OneDrive url that network places will recognize. The url you see in the browser will look like this: https://onedrive.live.com/?cid=xxxxxxxxx. If you try to add that, the location will be rejected. Microsoft isn’t forthcoming about how to do this either. I don’t know how I figured it out but I was able to add my original SkyDrive account many years ago with a url that looked like this:

https://nsnsj8.docs.live.net/xxxxxx/

Breaking that down:

https://nsnsj8.docs.live.net/ is the server address
/xxxxxxx/ is the account id.

To get the account id, open up your OneDrive account and look at the number that follows ?cid= at the end of the url:

https://onedrive.live.com/?cid=xxxxxxxxxx

So join those 2 bits together and you have the correct url.

Creating A Web Folder

Next, click “add a network place” or “location” or whatever your os supports.
Click “next” and enter the url you created above

add-place

Give it a name, say “One Drive”, which will appear in Explorer
Click finish.

When you open up Explorer, you’ll see a One Drive folder from which you can access all your OD files!

od-folder

If it doesn’t work for you, you can try to use https://d.docs.live.net/ in place ofhttps://nsnsj8.docs.live.net. I’m not sure if newer accounts still use the old server address – both work for me.

Questions?

Visit my forum » if you have any questions. For development work, you can contact me here ». And if you think this would be useful to others, feel free to share it by clicking one of the share buttons up top!

Add A Discussions List With Threaded View In Office 365 2013 Sharepoint Sites

discuss-2010A discussion board without a threaded view is like, well….having a blog on one site and its associated comments on another. You never know who’s replying to what. What makes Microsoft’s decision to remove the threaded view from Sharepoint 2013 even odder is that it worked fine in 2010 and still does in a 2013 site. All you have to do is save a discussion list as a template from a 2010 site and move it over.

If you want to add the list to a public site, you may find the template doesn’t show up when you click”add an app”. To workaround that restriction, try installing it on a sub site of the public site. Sub sites can be created with standard templates, so are not as restrictive as the public site. And it’s easy to make a sub site look like it’s part of the parent site by following this guide:
http://365.webbrewers.com/blog/Lists/Posts/Post.aspx?ID=29

If you don’t have access to a 2010 site or want to save some time, you can download the 2010 template here » Just follow the installation instructions on that page.
I set up a working demo of the list on a 2013 public sub site here » You can add some styling if needed to dress it up a bit.

Questions?

Visit my forum » if you have any questions. For development work, you can contact me here ». And if you think this would be useful to others, feel free to share it by clicking one of the share buttons up top!