Access SHTML file from website - AEMaaCS
Hi,
Environment: AEMasCS
I have a requirement to access the SHTML file using my website domain. So, I uploaded the SHTML file into my DAM, activated to publish instance, and tried to access the shtml file using my website domain. Unfortunately, I am unable to execute the directives inside the shtml file and browser rendering only the static text on the browser. This I am trying in AEM as a Cloud service environment. Does anyone have leads to render the shtml file on the browser from the AEM DAM?
On file upload, jcr:mimeType is blank. In this case, file is downloaded instead of rendered.
When I update the jcr:mimeType to text/html explicitly then render the static content only(not executing the directives).
Here is my SHTML code:
<!-- filename: index.shtml -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Server-Parsed HTML Example</title>
</head>
<body>
<!--#echo var="DATE_LOCAL" -->
<h1>Welcome to My Website!</h1>
<!--#if expr="$DATE_LOCAL = /Monday/" -->
<p>Happy Monday!</p>
<!--#else -->
<p>Hope you're having a great day!</p>
<!--#endif -->
<p>This page was last modified on <!--#echo var="LAST_MODIFIED" -->.</p>
<p>Internal URL: <!--#include virtual="/content/experience-fragments/test/global/en/components/xf/master.html" --></p>
<p>External URL: <!--#exec cmd="curl https://www.google.com" --></p>
</body>
</html>
Output:
Welcome to My Website!
Happy Monday!
Hope you're having a great day
This page was last modified on
Internal URL:
External URL:
Thanks,
Suresh