Rewriting Image and links url while page export | Community
Skip to main content
Level 2
May 9, 2020
Solved

Rewriting Image and links url while page export

  • May 9, 2020
  • 2 replies
  • 5069 views

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

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Nirmal_Jose

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

2 replies

Ankur_Khare
Community Advisor
Community Advisor
May 9, 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.

 

Level 2
May 9, 2020

Thanks for your reply. I will surely try this.

One more thing, same thing is happening with my links.

Link should refer to "http://localhost:4502/content/demo/en.html"

but, instead, its referring to

"file:///C:/Users/admin/Downloads/maximHtml/content/demo/fr.html"

 

Thanks in advance.

 

Ankita

 

 

Nirmal_Jose
Adobe Employee
Nirmal_JoseAdobe EmployeeAccepted solution
Adobe Employee
May 9, 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

Level 2
May 18, 2020
Thanks. It worked.