简体   繁体   English

如何检查Adobe CQ5组件中的anchor href属性是否为null?

[英]how to check null for anchor href property in Adobe CQ5 Components.?

Hi all i'm getting values from JCR in CRXDe these are rendering fine, but i have an a little issue, i want if url field is null that time it doesn't show any destination HREF but i'm not getting success my code is as: 大家好,我正在CRXDe中从JCR获取值,这些都可以正常显示,但是我有一个小问题,我想如果url字段为null,那时候它不会显示任何目标HREF,但是我的代码没有成功是作为:

    <a href="<%= obj.get("url") %>"><%= obj.get("label") %></a>

and for another field i'm doing like this, which is working perfectly: 而对于另一个领域,我正在这样做,这是完美的:

 <c:if test="${not empty properties.videoImage}">
    <img src="${properties.videoImage}" />
</c:if>

here i want to check "<%= obj.get("url") %>" is null so how can i do this, can anyone help me 在这里,我要检查“ <%= obj.get(“ url”)%>”是否为空,那么我该怎么做,有人可以帮助我吗

您是否尝试过类似的解决方案,例如<a href="${not empty properties.videoImage?properties.videoImage:''}">${not empty properties.label?properties.label:''}></a> 有关更多详细信息, 请参见此内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM