Using the design manager to create some custom page layouts which are associated with a custom content type that has some metadata. The pages in my library have extra information that we are using along with managed navigation and search faceting.

I've used the design manager to create snippets for the .html version of the page layout. For example I've created a section for Show only in Edit Mode and then a snippet for my managed metadata Topic. This allows the page editors/creators to assign the metadata while editing the page -- saves them having to open the properties panel. This works great and only shows the metadata tagging control while the page is in edit mode.

But I also want to show the tags to the end user -- just in a different place.

So I created a different Show only in Regular Mode section and put another Topic snippet in that part. And that works.

But some of our pages belong to two topics. In that case I don't want to use the default display of

Topic 1; Topic 2

Is there a way to customize how that is shown?

In looking at the snipped customizer I see the following attributes that seem promising

  • AlternateTemplate
  • CustomTemplate
  • DisplayTemplate
  • Template

I tried searching for information about how one might use those or even if they do what I hope. But I couldn't find anything because there are so many combinations of "SharePoint pagelayout snippet template" and combinations thereof.

I'm not sure what kind of values to put in those attributes and can't find any documention, so I tried putting a value in Custom template and got an error:

Cannot create an object of type 'System.Web.UI.ITemplate' from its string representation 'MyCustomTemplate' for the 'CustomTemplate' property.

Similar error for the other attributes.

Is there a way to customize how snippets display their content? How do I do that?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.