Plone 如何将portlet移动到内容';内容区?

Plone 如何将portlet移动到内容';内容区?,plone,diazo,Plone,Diazo,我想动态修改内容,以便以后可以将修改后的版本提供给主题的内容槽。用例将日历portlet定位在collective.cover行/列/单元格中 以下是我尝试过的: <replace css:content="#content .row:nth-child(2) .cell:nth-child(2) .tile.tile-edge"> <!-- These work (meaning levels above current selection CAN be copied)

我想动态修改内容,以便以后可以将修改后的版本提供给主题的内容槽。用例将日历portlet定位在collective.cover行/列/单元格中

以下是我尝试过的:

<replace css:content="#content .row:nth-child(2) .cell:nth-child(2) .tile.tile-edge">

  <!-- These work (meaning levels above current selection CAN be copied) -->
  <xsl:copy-of select="." />
  <xsl:copy-of select="../.." />
  <xsl:copy-of select="/" />

  <!-- However, neither of these do -->
  <xsl:copy-of css:select=".portletCalendar:first-child" />
  <xsl:copy-of select="//div[contains(concat(' ', normalize-space(@class), ' '), ' portletCalendar ')]" />
  <xsl:copy-of select="//div[@id='portal-personaltools']" />

</replace>

您遇到的唯一问题可能是依赖Diazo的工具来翻译XSL命令中的css选择器。仅当目标是当前选定的节点或其子节点时,它才起作用。因此,将其替换为XPath选择器:

<!-- replace one part of content with another -->
<replace css:content="#content .row:nth-child(2) .cell:nth-child(2) .tile.tile-edge">
  <xsl:copy-of select="//dl[@class='portlet portletCalendar']" />
  <xsl:apply-templates mode="raw" />
</replace>

<!-- make sure it doesn't show up in two places -->
<drop content="//dl[@class='portlet portletCalendar']" />


为什么不在collective.cover上添加日历磁贴呢?:-)你能告诉我们更多你想做什么吗?在没有XSL的情况下,这样做是可能的。(顺便说一句,我不认为那些mode=“raw”属性意味着什么。“mode”不是标签副本的属性。它只适用于apply template和template。)@SteveM,正如hvelard指出的,我试图实现的是模拟日历互动程序的存在,因为我不想通过采用第三方小部件来创建一个日历互动程序,而且我认为重用Plone的本机是很困难的,因为它绑定了portlet。你想让我更好地解释一下具体的方面吗?顺便说一句,mode=“raw”refs已删除,谢谢:-)我仍然不确定我是否理解这个问题,但我还是会尝试一下答案。如果我走错了,请告诉我。工作很有魅力,谢谢!顺便说一句,mode=“raw”不是必需的。mode=“raw”只有在需要执行删除操作时才真正需要。奇怪的是,即使删除操作应该在替换之前执行,mode=“raw”也不需要。XSL中的执行顺序更多地与选择器的特殊性有关,而不是与代码中的顺序有关。有点困惑!您是只引用标记还是还包括drop标记(因为它使用xpath选择器)?为了澄清我的案例,mode=“raw”甚至在xsl:copy-of和drop标记上使用相同的(xpath)选择器也是不必要的。