Where I work at, I’m in charge of maintaining the Technical aspect of our public facing SharePoint site. The content of the site is created by a separate team that does not have anyone with any HTML skillset. No need to mention to you that the WCM “What You See Is What You Get” editor is front and center to their work. As their IT contact, my job is to make their life as easy as possible, while ensuring they produce HTML compliant content. One of the coolest tricks I like to use, is to produce Reusable Content snippets for them. This blog post explains how you can create your own snippets for publishing sites.
What is it Anyway?
First off, what is the Reusable Content feature in SharePoint? It basically is a list in every Publishing site that contains pieces of valid HTML that can be easily reused in various pages. These snippets can be made available through a button in the ribbon bar:
As you can see in the example above, I’ve created two custom Reusable blocks, Top of Page and Haut de la page. These HTML pieces, simply insert an anchor link floating right on the page and that links back to the top of the current page.
Add New Snippets
If you want to go and add new snippets, the easiest way for you to achieve this is through the Ribbon. In the picture above, under my two custom snippets, you see the option “More Choices…”. Click on it.
The Reusable Content Dialog will appear. In the top left corner, click on “Open List“
A second popup will appear and you will be brought to the Reusable Content List. To add a new item to that list, click on “Add new item“
On the new item dialog, fill in the appropriate information.
The two things to watch out for are the “Automatic Update” and “Show in drop-down menu” checkboxes. The first one is where the reusable content idea takes all of its sense. By checking this option you basically say to SharePoint that when selected, this snippet should insert a reference to the reusable content object. Meaning that if you decide to change it later on, all pages that are using it, will automatically see their content updated. In my example above, assuming I change title and want my signature to be updated on all of my pages at once when I modify it, all I have to do is to keep the check box checked. However, if I want every page to have a static copy of my signature, so that when I change it, only the new pages have the new info, I would uncheck it. This will then inject the HTML directly in the page instead of just a reference to my Static Content object. The second check box allows you to have your new snippet shown directly under the ribbon’s button (see Picture #1 or #2). If you decided not to enable this option, your snippet will still be accessible in the Reusable Content dialog window (see picture #3).
Now that our custom Reusable Content Snippet has been created, now’s the time to go and play with it. Simply open a new publishing page in edit mode, and navigate to the Reusable Content menu. Click on the button and select your newly created snippet…Voilà!
Two things to watch out for. First one, is the HTML code, you’ll actually need to use the HTML control from the editor to insert HTML code in your snippet. The second one, is that in order for your users to be able to use your snippets, they’ll need to be individually approved in the Reusable Content list before being visible by all.