Rewriting Image and links url while page export

Avatar

Avatar

Ankita_Aggarwal

Avatar

Ankita_Aggarwal

Ankita_Aggarwal

08-05-2020

Hi All,

 

I am able to export page into a zip file with required clientlibs and assets.

Clientlibs are reflecting on the page perfectly, but assets are not, they are not referring the correct path , where they are downloaded in the zip file, instead they are pointing to the path, when an asset is placed on a page.

For example: 

Image should refer path "\content\dam\demo\image.png"

but , its referring path is

"/content/demo/en/_jcr_content/par/image.img.jpg/1588834659990.jpg"

 

Please help.

 

Thanks

Ankita

 

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Nirmal_Jose

MVP

Avatar

Nirmal_Jose

MVP

Nirmal_Jose
MVP

09-05-2020

Hope you are using the Page exporter functionality in AEM itself. If not, please use the capability. Documentation available at [1]

Page exporter is a capability built on content sync framework and it allows a config setup for rewrite. You can create a template for export and in it, you can mention like below 

    <page
        jcr:primaryType="nt:unstructured"
        deep="{Boolean}false"
        extension="html"
        includeImages="{Boolean}true"
        type="overridepages">
        <rewrite
        	jcr:primaryType="nt:unstructured"
        	clientlibs="REWRITE_RELATIVE"
        	links="REWRITE_EXTERNAL"
        	images="REWRITE_EXTERNAL"/>
    </page>   
    <clientlib-category-name
        jcr:primaryType="nt:unstructured"
        extension="css"
        path="/etc/designs/clientlibs/path"
        type="CSS"/>

 

[1] - https://helpx.adobe.com/in/experience-manager/6-4/sites/administering/using/page-exporter.html

Answers (1)

Answers (1)

Avatar

Avatar

Ankur_Khare

MVP

Avatar

Ankur_Khare

MVP

Ankur_Khare
MVP

08-05-2020

Hi Ankita,

 

Few things to note-

When you content author any image and you drag and drop any image it will referred from jcrcontent like you are seeing above.

 

Even you can see how it is stored under jcrcontent in aem.

 

Now to get the path as you want you should use a pathfield in your dialog and not dragging dropping any asset so that it refers to the path as you want.