DefaultAssetImageLocation on RichHtmlField is ignored

I am trying to set a centralized location for images and assets of a site collection through the Page Content field on the Publish page in SharePoint 2013.

According to MSDN documentation.

How to set up the Asset Collector in SharePoint Server 2010

You can define a custom selection shortcut for the RichHtmlField control or for the RichImageField control inside the page layout:

  • Go to \ Program Files \ Common Files \ Microsoft Shared \ Web Server Extensions \ 14 \ TEMPLATE \ FEATURES \ PublishingLayouts \ PageLayouts and open the .aspx page layout.
  • Find the publication control associated with the control that uses the asset collector. For example, it represents the HTML Editor control field.
  • Add one or both of the following attributes to this tag:

    DefaultAssetLocation . Defines the URL of a custom shortcut in a URL picker.

    DefaultAssetImageLocation . Specifies the URL of a custom shortcut in the image picker.

    These URLs must refer to site collection URLs that point to a library, list, or other location in your site collection, such as / ReusableContent.

    For example, the following control defines custom shortcuts / URLpicker and / imagepicker for URLs and image pickers, respectively.

    <PublishingWebControls:RichHtmlField id="Content" FieldName="PublishingPageContent" DefaultAssetLocation="/URLpicker" DefaultAssetImageLocation= "/imagepicker" runat="server"/>

    Likewise, the next control defines a custom shortcut for its selection of images.

    <PublishingWebControls:RichImageField id="Content" FieldName="PublishingPageImage" DefaultAssetImageLocation="/imagepicker" runat="server"/>

  • Save your changes and close the .aspx page layout.

I was able to set the default location without issue in the RichImageField control using the below code

<PageFieldRichImageField:RichImageField FieldName="543bc2cf-1f30-488e-8f25-6fe3b689d9ac" DefaultAssetImageLocation="<% $SPUrl:~sitecollection/SiteCollectionImages/ %>" runat="server" />

Note: $ SPUrl is used in my example above, it took me to get it to work. Ref: Using DefaultAssetImageLocation for RichImageField in Page Layout

However, adding either to DefaultAssetImageLocation

or DefaultAssetLocation

to the RichHtmlField does not change the behavior of the insert Picture command in the SharePoint ribbon.

If the user selects Insert -> Picture -> From SharePoint using the ribbon, I would expect the Asset picker to use the value set on the property DefaultAssetImageLocation

in the RichHtmlField control, but that doesn't seem to be the case.

Anyone could get this to work in SharePoint 2013 or use a workaround?

+3


source to share





All Articles