Microsoft Power Pages: Content Snippets – Use & Benefits

Microsoft Power Pages: Content Snippets – Use & Benefits

In Power Pages portals, there are instances where you might have text or resources that need to change fairly often and in several locations. Perhaps you want to swap out a featured product or item on your home page that is also featured on several other pages, or you have a notification or notice that needs to appear on several pages. In these scenarios, the updates you want to make are simple, but trying to track down everywhere you want to make those changes is where you might run into difficulty.

Thankfully, Microsoft Power Pages offer a feature called content snippets that can help you reduce your workload for these kinds of changes. Content snippets are a way to take a piece of text or HTML code that can be entered into a single content snippet, and that snippet can be placed on any page where you want that content to appear. When your site’s pages are displayed, the snippet you added will be provided as the full text/HTML code you entered.

With the examples above, if you have a notification that appears in several places on your site, or you have a featured product description with an image that changes from time to time, and the notification text or the featured product description and image HTML code is placed in a content snippet, that snippet can be placed anywhere in your site where that item should appear. It will be displayed as the full notification message or featured product with the image. Then, if you need to make changes to the notification or featured product in the future, you only need to update the related content snippet, and all instances where that snippet was referenced will update accordingly. The benefits of this approach are that content can be easily managed and updated by your development and content teams.

Benefits:

Save Time Tracking Down Items to Update

You will not need to worry about tracking down each location where a piece of text/HTML is used and updating them all manually. You can simply update the content snippet for that text/HTML, and all places where the snippet is referenced will be updated.

Know That Your Messaging is Consistent

Since all the snippets use the same text/HTML, you can avoid instances where pages may have different wording for the same intention or where the message may have been older and neglected to be updated.

Improve Managing and Reviewing Translations for Your Portal

For each language that your portal supports, content snippets can be configured per language so you can manage the same messaging in different languages and easily compare them.

Content Snippets:

Creating Content Snippets

To create a content snippet, go to your portal management app, and navigate to the content snippets entity, then click the new button. On the creation screen, the name field is what will be entered elsewhere on your site to render this content. Besides that, set the website that this snippet is intended for, the display name to help note the intent of this snippet, and the type to specify if the content will be rendered as text-only or as HTML code. Finally, enter the content that you want to be displayed into the value field. (If you have selected the Type as HTML, you will be able to use the editor tools to add some basic formatting).

Please note that if your portal supports multiple languages, you will want to create a content snippet for each language that should have the same value in the name field and set the content snippet language accordingly.

Using the Snippet

To use the snippet, navigate to the web page or template record where you want to add the snippet, and open the HTML editor. Then you can add the following line to insert your snippet (swap out the ‘snippet_name’ with your desired snippet’s ‘Name’ field):

{% include 'snippet' snippet_name: 'Example_Content_Snippet' %}

With this addition, when your page loads, it will have the content snippet that you specified in the location where you entered the snippet:

Now, any updates you would like to make to this snippet can be done on the content snippet record and will automatically be updated anywhere you have added the snippet to your site.

Using content snippets will allow your development and content teams to easily manage the content on your Power Pages portal and will save you time and effort in tracking down and updating this content, should you need to do so in the future. Of course, content snippets are just one feature that can help your team more effectively use a Power Pages portal. Here at TopLine Results, we would be happy to assist you and your team to ensure that you are leveraging your Power Pages to their full capacity. Please feel free to contact us at info@toplineresults.com or (262) 691-1444. 


Leave a comment!

You must be logged in to post a comment.