How to upload a content image and allow an enlarged view when clicked?

Hi all,

My use case is that I am creating content (all types) using the REST API.

My issue is that when I create content manually that has an image, the image can be clicked for a pop-up enlarged view of the image.  But when I create content via REST this does not occur.

What I am finding is that the URL patterns are different for manually created vs. programmatically created content.  When I upload the image via REST I upload it to CFS and then use the [View:] macro code in the content body.

This URL is created by uploading an image and placing it some content:


And this URL is created by creating content manually and dropping an image into the content:


My expectation is that the /resized-image/ path is what triggers the addition of the JS code for the enlarged image pop-up.

Question: How can I translate the non-popup URL to a pop-up URL?  Or do I need to upload the image using a different REST endpoint?


  • The resized-image endpoint works on any file stored within the CFS. Images stored in the CFS and embedded in HTML (via [view] or <img src="..." />) will be saved/secured with the content being created (whether created on-site or via REST).

    There is logic within the platform client script libraries that detects <img /> tags referencing the resized-image/ handler and inspects them to add the pop-up viewer support.

    You could embed the <img /> with the resized-image/ handler directly (it's what the on-site editor does). The format for the resized-image/ handler is:


    Where the RESIZE_METHOD is an integer:

    • 1 = Scale down (Default). Resizes the image, maintaining its aspect ratio, only smaller (so small images are not enlarged), to the bounding box of WIDTH_IN_PIXELS by HEIGHT_IN_PIXELS
    • 2 = Zoom and crop. Resizes the image (maintaining the aspect ratio) to cover WIDTH_IN_PIXELS by HEIGHT_IN_PIXELS and then center-crops the image to WIDTH_IN_PIXELS by HEIGHT_IN_PIXELS. This will resize a small image larger and will always return an image at the requested width and height.

    The generation of this URL can also be done through the API via $core_v2_ui.GetResizedImageUrl() in scripts or IUI.GetResizedImageUrl in plugins.

  • Thanks.  As always that is exactly what I was looking for.

Reply Children
No Data