How to fix Twitter embed in SharePoint

MFW another API just stops working without returning any errors

Twitter has always been good for developers, except for those who’d like to embed anything – hence making it possible to interact with Twitter’s contents on other sites than Twitter. I guess it’s understandable, but they seem to hate anyone trying to embed feeds, searches or anything on their sites. And they express their hate by making the developers’ lives more difficult… This time by silently breaking the embed script in a way, that’s tricky to work around.

The Problem

In February 2018, Twitter announced that their widgets will start rendering fallback markup on IE9 and IE10 “in the near future”. Since SharePoint 2013 and 2016 are locked in document mode of IE 10 (i.e. using IE on SharePoint sites causes the user agent to be roughly that of IE10), that means basically everyone, who’s using Twitter embeds on SharePoint, will be seeing empty Twitter embeds henceforth. Well, save for SharePoint Online users, since SharePoint Online renders in whatever mode Microsoft chooses that week.

Anyway – that change caused surprisingly small issues. Widgets still rendered, until roughly 2 weeks ago. We started getting reports of Twitter being utterly broken – the embed being completely empty without any fallback rendering whatsoever. What’s worse, the embed fails silently (the code looks like it just checks the user agent and ends the execution – thanks a lot, Twitter, much appreciated!)

What’s even worse, is that it applies to IE11 users, too – if they’re in SharePoint, or on a site that’s running in compatibility mode (such as all sites on “intranet” zone). And since IE seems to be most actively used in large organizations, especially on internal communication channels, Twitter just decided to block the majority of IE users in the world from accessing their service via embeds. 

Great job.

Luckily, there’s a dirty hack for this situation!

Continue reading

How to show any page in a pop-up in SharePoint

This ages old trick deserves to be published – since it makes it easy to quickly show info from pretty much any another page on pretty much any classic SharePoint page (in a SharePoint-compatible pop-up). So, here goes:

Using SharePoint’s JavaScript library to open an arbitrary pop-up

Yes – SharePoint contains all the functionality out-of-the-box, and you almost don’t have to do anything yourself! Let’s see how this works.

Continue reading

Opening a web part page in maintenance mode

SharePoint doesn't work as intended

Can’t access a web part page because of a broken web part? Yeah, that’s a classic issue – and it’s nicely ported into Modern world, too! In these cases, web part page maintenance mode comes in handy!

There’s a query parameter available for accessing it. For whatever reasons, it’s different for Classic and Modern mode, though. Why make things easy if you can make them dificult, right? 🙂  Continue reading

Troubleshooting: Anonymous access on a public SharePoint site collection failing

SharePoint vs. Anonymous

Ah, everyone’s favorite, classic topic! Debugging SharePoint On-Premises configuration issues is the best thing since sliced bread, right? This post is about allowing/enabling Anonymous Access to a site collection – a simple configuration, that “simply works” like once every ten times you try it.

Symptoms

A lot of different ways to hit your head on this one. In any case, your on-premises SharePoint doesn’t allow anonymous access to a site where you are trying to allow it. Most typically, they’ll just encounter 401 error when accessing the site, or they might be missing some of the content or styles, resulting in partially broken site.

Causes

Usually incorrect configuration or non-published resources. Multiple reasons can cause this, though, I’ll describe some of them below with the solutions.

Solutions

A lot of things to check – let’s go through all of the most typical issues here! Continue reading

Don’t remove the root site of your classic SharePoint Site Collection!

Let me explain SharePoint

A quick heads-up – if you remove the root site of your classic SharePoint Site Collection, that site’s going to be troublesome to deal with. Whereas you can always restore a normal site from the site collection recycle bin, the root site you can’t. You actually can’t access the recycle bin after removing the root site, nor can you make magic happen with PowerShell commandlets anymore.

Site Collection Recycle Bin

Site Collection Recycle Bin – where you could access your removed sites, if you still had the root site!

The Recycle Bin would be located at a URL like this: https://<yoursite>/_layouts/15/AdminRecycleBin.aspx, but after the site is removed, it won’t be there. 

Continue reading