Content and script editor web parts missing in SharePoint

Missing two of your favorite web parts? Don’t fret.

Make sure the site collection feature “SharePoint Server Publishing Infrastructure” is activated

Make sure the site feature “SharePoint Server Publishing” is activated

Still not there? Check “Settings” in the admin center to see if custom scripts are allowed on personal and self-service created sites (allow both). This can take up to 24 hours to take effect.

If you can’t wait (and you’re using SharePoint Online), use PowerShell to make the change immediately, changing my site details to your own

$adminUPN="nate@sharepointlibrarian.com"
$orgName="sharepointlibrarian"
$UserCredential = Get-Credential -UserName $adminUPN -Message "Enter password"
Connect-SPOService -URL https://sharepointlibrarian-admin.sharepoint.com -Credential $userCredential
Set-SPOsite https://sharepointlibrarian.sharepoint.com -DenyAddAndCustomizePages 0

Repeat the last line for each site on which you need to quickly activate this setting. For example, I would run it again on https://sharepointlibrarian1.sharepoint.com/sites/AnotherSite

Your web parts should have now returned! Good luck.

SharePoint’s Content Query Web Part (CQWP) is missing!

Applies to: SharePoint Server/on-prem

I love SharePoint’s Content Query Web Part (CQWP) – but if you’re missing a feature in your site collection(s), you may not have it! Luckily you can get it back in just four clicks.

  • Go to Site Settings
  • Click “Site Collection Features” under “Site Collection Administration” (Note: Must have full control or site collection administrator permissions to see this option)
  • Activate “SharePoint Server Publishing Infrastructure
  • Now your CQWP should be available as a web part under Content Rollup.

If you need to activate the SharePoint Server Publishing Infrastructure across all site collections in a web app, I recommend checking out 
Salaudeen Rajack’s site, SharePointDiary.com, for instructions on doing this via PowerShell.

How to give SharePoint link lists a professional look out-of-the-box using the icon library

In the modern SharePoint experience, you can clean up ordinary link lists with very little effort, thanks to SharePoint’s icon library.

chrome_2018-10-23_15-30-53

Whether you need a Teams icon (teams), dog (fangbody), tooth (teeth) or football (football), you can search for icons and use those for adding visual cues and iconography to your sites. Here’s how you can implement this on your page(s):

Continue reading “How to give SharePoint link lists a professional look out-of-the-box using the icon library”

How to create a SharePoint modal pop-up message on page load

2018-05-15_07-55-34

This solution involves two files:

  • The aspx page that holds the content of the pop-up
  • The script that loads the aspx page in a modal dialog upon page load
  1. Save this .aspx page to your “Site Pages” directory.
    -OR-
    Copy and paste the following into a new .aspx page in your Site Pages or Pages (Settings wheel –> Site Contents –> Site Pages or Pages) directory:

    Wrap this block in style tags:
    [code]
    h1 {
    color: #ed7522;
    text-align: center;
    }
    h2 {
    color: #ed7522;
    text-align: center;
    }
    p {
    color: #1f2844;
    font-size: 1em;
    }
    input {
    font-family: “Segoe UI”;
    font-size: 1em;
    }
    [/code]
    Paste directly beneath (no additional tags):
    [code]

    [/code]

  2. Modify the content in the aspx page beneath the modal-content div and above the input tag to include your own images, formatting and message text.
  3. Save this javascript file to your Site Assets (Settings wheel –> Site Contents –> Site Assets) or scripts folder
    -OR-
    Copy and paste the following into a new javascript file in your Site Assets:

    Note: Wrap the following in script tags:
    [code] _spBodyOnLoadFunctionNames.push(‘showPopup’);
    function showPopup() {
    var options = {
    title: “Notice“,
    url: “https://sharepointlibrarian.sharepoint.com/SitePages/HomePopUp.aspx” };
    SP.UI.ModalDialog.showModalDialog(options);
    }
    [/code]
  4. Update the script to include the URL of your newly saved aspx page and a title for the pop-up window (optional).
  5. Add a content editor web part to the page on which you’d like the pop-up.
    1. Edit page
      editpage
    2. Add web part
      insert web part
    3. Edit web part
      editwebpart
    4. Paste URL to the javascript file in your Site Assets and click “OK”
      content editor pop up
    5. Save page/stop editing
      stopediting

That’s it! Your pop-up should now function upon page load. When/if you wish to “turn off” the pop-up without deleting the files (so you can reuse later easily) just add “//” before line 7 in the javascript file and save to “comment out” the function. This prevents the pop-up from loading. When you’re ready to use the pop-up again just remove the two slashes and save.
comment out

I recommend using SharePoint Designer to easily access and modify the ASPX page and/or javascript file.

A better way to display “today’s events” from multiple calendars in SharePoint on your intranet home page

today at LMH

Below on the left are two traditional, out-of-the-box solutions for showing Today’s events in SharePoint. Notice how both take up a lot of extra space repeating today’s date (which we don’t need to see at all in a web part called “Today’s Events”) or showing gray space where there are no events. Soak that in – prime real estate on your home page goes to non-existent events. These also may require overlays and other manual labor processes that need adjusted every time a calendar is added or removed.

But on the right is what you could have. It uses search instead and displays events from all calendars a user has access to in one place. It shows only the necessary information on the home page and links to full details. And with a little CSS included in this post, it can look polished and themed. Imagine all you could do with that saved space on your home page…

Also seen above: Adding local weather to your SharePoint intranet home page
and a “this week’s menu” button for your intranet

Continue reading “A better way to display “today’s events” from multiple calendars in SharePoint on your intranet home page”

Adding local weather to your SharePoint intranet home page

weatherI jokingly said at a recent presentation that I thought adding weather to our intranet’s home page was a good idea for employees like me who work in the basement and don’t see much of “the outside.” But it can also help with planning and decisions depending on your industry and daily routines.

Accuweather has a free script for a widget you can use that resizes perfectly on different screen sizes. I’m impressed with its simplicity and how dynamic it is.

All you need is a script editor where you’re placing the weather on your page and the following script from Accuweather.com. This script will work as-is from a straight copy and paste, but you should generate your own code from their website to paste after the closing style tag so that when clicked, users will be taken to more info specific to their location instead of mine. You can start from scratch on their site, just be sure to add the “style” tag and content below before the script they generate for you. This will get rid of a rather pesky button they include.

<style>
.aw-toggle{
display:none;
}
</style>
<a href="https://www.accuweather.com/en/us/lawrence-ks/66044/weather-forecast/328846" class="aw-widget-legal">
</a>
https://oap.accuweather.com/launch.js

Embed quizzes and/or results in SharePoint using Microsoft Forms

Asset 1quiz.pngThis morning I looked around for either pure javascript or custom service solutions for trivia or quiz embeds for SharePoint. The out-of-the-box survey web part wouldn’t allow the kind of features I needed such as showing a message upon submission about correct and incorrect answers, and I wanted something more robust than a newsfeed or Yammer quiz. I also wanted users to easily be able to change their own quiz questions and answers and no high-maintenance code solution was going to cut it.

What I learned? There aren’t a lot of free solutions out there for quick quiz creation and embedding in SharePoint. And the ones that are out there don’t look the greatest. Then I remembered Microsoft Forms has a quiz function! Don’t these look great? Even better – you can embed in SharePoint Server/On-Prem or SharePoint Online/O365!

sidebyside

Microsoft Form’s quiz capabilities are incredible. In five minutes you can create a quiz that looks good, is easy to update and has features ordinarily only available with a premium subscription through other services. And as seen above, you can embed the results as well, making voting fun or showing a group how everyone is performing as a whole on a topic quiz. Here are some of the great features you get with Microsoft Forms:

Continue reading “Embed quizzes and/or results in SharePoint using Microsoft Forms”

Upgrade your image slider on SharePoint

Your image slider is okay. But you’d like it better if it had a makeover (50 points to whoever can guess the commercial reference).

This post will show you how you can take your out-of-the-box content search web part slideshow from this:

2018-03-24_17-10-39

to this:

2018-03-24_17-26-46

This solution supports multi-line descriptions that don’t get cut off. It gets rid of that dreadful partially transparent overlay and gives you more of your photo uninhibited by messy design. It’s more modern, lighter and sure to impress. At the end, be sure to adjust the CSS to match your own color scheme and size needs.

Continue reading “Upgrade your image slider on SharePoint”

How to create a dynamic “this week’s menu” button for your intranet

People jokingly (or not) sometimes tell me the only reason for which they use the intranet is the cafeteria menu. So on a recent draft of a redesigned homepage, I introduced a prominent “Menu” button that would always be linked to the most recent menu uploaded by dining services.

menu

Previously people would click a link which took them to a document library where the current menu lived, and would open it there. 2 clicks.

I had two goals for this project.

  1. Get it down to 1 click.
  2. Never have to manually update the link for the button. Set it, forget it.

Note: this could easily be applied to newsletters, updates, meeting minutes, etc. Anything that is published on a regular basis that could benefit from an always-current hyperlinked button.

Continue reading “How to create a dynamic “this week’s menu” button for your intranet”

Embedding Power BI Report Server (PBIRS) reports in SharePoint

02

If you’re on-premises and looking to embed a Power BI Report Server report in SharePoint, you’ll find it’s not as easy as O365 embeds. But it’s certainly possible; here’s how:

Continue reading “Embedding Power BI Report Server (PBIRS) reports in SharePoint”