AEM中数字资产的URL映射

问题描述 投票:0回答:2

我想为我的网站的DAM /数字资产提供URL映射。特别是对于PDF。每当我提供PDF的下载链接时,它都会显示PDF的完整文件夹结构。我想缩短这一点。我正在使用AEM 6.2。

aem sling url-mapping
2个回答
2
投票

您还可以在Sling资源解析器工厂配置中执行映射

1. Go to system config manager and search for Sling resource resolver factory.
2. Add new entry "/content/dam/you-project-structure/>/" and "/content/dam/you-project-structure/</"  

1
投票

您可以在/etc/map位置定义URL映射。看看https://sling.apache.org/documentation/the-sling-engine/mappings-for-resource-resolution.html,其中包括这个例子:enter image description here

在/ etc / map下,您可以创建一个文件夹,然后在该文件夹中创建一个包含以下属性的.content.xml文件:

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
          jcr:primaryType="sling:Mapping"
          sling:internalRedirect="/content/dam/the/full/path/to/your/file.pdf"
          sling:match=".+/content/short-url.pdf"/>
© www.soinside.com 2019 - 2024. All rights reserved.