0

Is there a way to edit or customize the output of Design Manager Snippets in 2013?

If I create a snippet for a property containing a TaxonomyFieldMulti I get this

<div data-name="Page Field: Categories">
    <!--CS: Start Page Field: Categories Snippet-->
    <!--SPM:<%@Register Tagprefix="PageFieldTaxonomyFieldControl" Namespace="Microsoft.SharePoint.Taxonomy" Assembly="Microsoft.SharePoint.Taxonomy, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
    <!--MS:<PageFieldTaxonomyFieldControl:TaxonomyFieldControl FieldName="b009868e-1574-4327-b1da-488660ade3f4" runat="server">-->
    <!--PS: Start of READ-ONLY PREVIEW (do not modify)-->
    <div align="left" class="ms-formfieldcontainer">
        <div class="ms-formfieldlabelcontainer" nowrap="nowrap"><span class="ms-formfieldlabel" nowrap="nowrap">Categories</span>
        </div>
        <div class="ms-formfieldvaluecontainer"></div>
    </div>
    <!--PE: End of READ-ONLY PREVIEW-->
    <!--ME:</PageFieldTaxonomyFieldControl:TaxonomyFieldControl>-->
    <!--CE: End Page Field: Categories Snippet-->
</div>

Which renders the following

<div data-name="Page Field: Categories">
    <span title="Design Manager">Design Manager</span>
    ; 
    <span title="SharePoint 2013">SharePoint 2013</span>
</div>

Not exactly what I wanted, lets say I wanted an unordered list (UL) instead, is there a way to customize the output of these snippets?

Thanks

1

Ultimately these snippets are basically just for preview purposes - they would not change the actual server side rendering of the final components! You could change various settings, but mainly styling via CSS (http://msdn.microsoft.com/en-us/library/office/dn205275.aspx) but this won't affect the final results.

Exactly for the Metadata publishing field (PageFieldTaxonomyFieldControl:TaxonomyFieldControl is unfortunately Sealed - so no chance in overriding behavior of the rendering).

You should rather use the TaxonomyWebTaggingControl as described here http://pholpar.wordpress.com/2010/02/15/build-your-own-user-interface-components-using-the-taxonomy-controls/ - which should give you more control into the final rendering.

Still, with regards to the actual snippets themselves, there is not much you could do.

  • I did have a look at the controls in the Microsoft.SharePoint.Taxonomy namespace but couldn't really find anything that matched my needs. The TreeControl Class is the only one rendering something close by but doesn't really seem to fit here anyway (no way to input the field name) – Eric Herlitz Feb 17 '14 at 22:33
  • It would dificult to replace that control with another one, you need to rebuild the whole logic really - that unless is fine with you only for "read-only" experience which you could choose to rebuild. There is no other control indeed that handles managed metadata, but the ones already mentioned above. – Marius Constantinescu - MVP Feb 18 '14 at 1:37
  • I don't mind creating web parts or custom controls for data output, it's just a matter of what I shall tell my customers why things are taking considerably much more time than what they expected from visiting some SharePoint Seminars! – Eric Herlitz Feb 18 '14 at 8:28
  • My take (with regards to Design Manager) - Do not rely ONLY on Design Manager for integrating your designs. In my experience, it still lack maturity, though an great tool so far. We've only used this mainly for people without any SharePoint experience or lacking other tools (such as VS or SPD) - real designers - as a support tool for their limited independence. Anything else - fallback to real SP tools. – Marius Constantinescu - MVP Feb 18 '14 at 8:54
  • I agree, lets hope they extend it in the feature – Eric Herlitz Feb 18 '14 at 12:20

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.