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
sharepoint publishing sharepoint-2013


source to share


No one has answered this question yet

Check out similar questions:

17
SharePoint Redirect site logo tied to root site collection home page
2
Mistake. Only content-based content controls are allowed directly on the content page that contains the content controls. in the SharePoint 2016 page layout
2
SP2013 - Adding a Content Editor Web Part to a Custom Layout Page
1
Sharepoint 2013 custom error page
1
Change subscriber selection scope (for object resolution) in SharePoint 2007
0
Error while using SharePoint apps
0
Need help with sharepoint 2013 Rest API with Ajax Call
0
Creating a page layout in visual studio 2010
0
SharePoint page layout -new does not appear in Ribbon- Page layout
-1
Access 2013 - Custom Web Application - Access Denied error while creating



All Articles
Loading...
X
Show
Funny
Dev
Pics