I'm trying to add custom atom:tags for RSS feed in AEM.
I've overridden OOTB code to /apps/cq/Page/feed.jsp
from equivalent libs
path.
I'm able to extract the image path from the jcr-node
, but not able to add it to the custom tag successfully.
How to add a custom tags in the taglibs for the prefix atom?
Imports
--%><%@ page session="false" %><%
%><%@ page import="com.day.cq.commons.Externalizer,
com.day.cq.wcm.api.Page,
com.day.cq.wcm.api.WCMMode,
java.util.Iterator,
javax.jcr.Node,
com.day.cq.wcm.api.components.ComponentContext" %><%
%><%@ taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0" %><%
%><%@ taglib prefix="cq" uri="http://www.day.com/taglibs/cq/1.0" %><%
%><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%
%><%@ taglib prefix="atom" uri="http://sling.apache.org/taglibs/atom/1.0" %><%
%><cq:defineObjects /><%
Custom code
Node jcrNode = currentNode.hasNode("jcr:content") ? currentNode.getNode("jcr:content") : null;
Node imageNode = jcrNode != null && jcrNode.hasNode("image") ? jcrNode.getNode("image") : null;
String image = imageNode != null && imageNode.hasProperty("fileReference") ?
imageNode.getProperty("fileReference").getValue().getString() : null;
%><atom:feed id="<%= url %>"><%
%><atom:title><c:out value="<%= title %>"/></atom:title><%
if (subTitle != null) {
%><atom:subtitle><c:out value="<%= subTitle %>"/></atom:subtitle><%
}
if (image != null) {
%><atom:image><c:out value="<%= image %>"/></atom:image><%
}
%><atom:link href="<%= link %>" rel="self"/><%
Image tag is not identified
<atom:image></atom:image>
Error logs
.feed HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught SlingException
org.apache.sling.scripting.jsp.jasper.JasperException: /apps/cq/Page/feed.jsp(60,18) No tag "image" defined in tag library imported with prefix "atom"