gpt4 book ai didi

css - 添加到 parsys 的内容显示在包含 html 之外。我怎样才能让它显示在里面?

转载 作者:行者123 更新时间:2023-11-28 07:54:00 26 4
gpt4 key购买 nike

我正在尝试创建一个 adobe cq 组件并包含一个 parsys 元素,用户可以将其他组件拖入该元素。但是,当我将元素拖到我的 parsys 组件中时,它们总是显示在我包裹在我的 include 周围的 html 标签之外。我做错了什么?

我的组件 jsp 中的 html

<div class="div-one">
div one
</div>
<div class="div-two">
<cq:include path="par" resourceType="foundation/components/parsys" />
</div>

我的组件的 content.xml

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:description=""
jcr:primaryType="cq:Component"
jcr:title="title"
sling:resourceSuperType="foundation/components/parbase"
allowedParents="[*/parsys]"
componentGroup="My Group"
cq:htmlTag=""/>

在我认为我将组件拖入 div-two 之后,html 如何在浏览器中呈现

<div class="div-one">
div one
</div>
<div class="div-two">
<cq:include path="par" resourcetype="foundation/components/parsys">
</cq:include></div>
<div id="myComponent" class="row">
</div>

最佳答案

cq:include 是一个标签库元素,不应出现在呈现的 HTML 中。

确保在使用 CQ 标签库时在每个 JSP 文件的顶部包含 global.jsp:

<%@ include file="/libs/foundation/global.jsp" %>

有关 CQ 标签库的更多信息,请参阅 this doc .

关于css - 添加到 parsys 的内容显示在包含 html 之外。我怎样才能让它显示在里面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30228489/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com