问题标签 [diazo]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
839 浏览

plone - diazo xsl:template not applying when inside secondary rules file

I am using Diazo with Plone and have some xsl code that is working in the root of rules.xml but not inside an included .xml file. I would like to keep my rules.xml simple and keep the section specific styling inside each section's .xml file.

How can I add the class "subNav" to all li's using diazo from section-one.xml?

Not working (but desired):

rules.xml

section-one.xml

Working (but not desired):

rules.xml

section-one.xml

0 投票
1 回答
285 浏览

plone - XSLTApplyError: xsl:comment : '--' or ending '-' not allowed in comment

I am really new to plone and diazo so forgive me if the answer to question is too obvious.

I was asked to create a diazo theme for a website running on plone. Right now i'm at a state where i where i think the theme is reasonably complete(without rules) and i uploded it via .zip to the plone planing to create the rules in plones rules editor. Made a handful of them and hit the preview button to see whether what i am doing is even repotely going into the right direction but hat it showed was this error.

After spending quiet some time with a well known search engine i'm still uncertain if that is a mistake i made in the rules.xml or something the websites admin has to look at.

Any and all help will be appreciated.

Edit version information:

Edit rules so far

I didn't create that file myself. It was automatically created by plone upon uploading the .zip without a rules.xml in it. The four(that's how far I got until I first stumbled over the error) rules were created by plones editor. At first I thought i messed up the comments somehow, seeing that is states "--" and "-" in the error message, but i couldn't find where and DW didn't point out any syntac errors either when opening the file in there.

Edit Solution:

Typo found in the theme.html . One comment ended on "->" instead of "-->" which i never new works for html in the first place.

0 投票
2 回答
437 浏览

xslt - 如何使用重氮保留标签之间的空格?

我正在创建一个简单的重氮主题。

rules.xml是这样的:

在内容文件中,有以下几行:

我希望这些行在输出 html 中以完全相同的方式复制。然而,他们变成了这样:

也就是说,每次我有一个空的 html 标记时,比如<input ... />or <br />,它和下一个标记之间的空格就会被删除。

我尝试使用<xsl:output><xsl:preserve-space>选项修改此行为,但没有成功。

我能做些什么?

0 投票
2 回答
108 浏览

plone - 如何使用重氮使用常见的标题替代页面

我有两个静态 html 文件,一个是主页设计,另一个是常规页面设计。

我有一个规则来确定使用哪一个,如下所示:

虽然我现在意识到这两个页面有共同的元素,比如标题。有没有办法从一个页面或其他地方使用标题,这意味着如果我对 htmlt 进行更改,只需要在一个地方完成?另一种问法,你能把设计文件混合在一起吗?

0 投票
2 回答
284 浏览

plone - 根据用户角色更改重氮主题元素

是否可以根据 Plone 中的用户角色来制作重氮主题的元素?例如:我想在主题中为某些特定角色提供不同的标题图像,并在用户登录后立即在网站上进行这些更改。

这个问题可能是相关的,但我更愿意只通过角色分配来管理它。

0 投票
2 回答
149 浏览

xslt - 动态在标签中插入元素(全部在“内容”端)

我需要即时修改标签的“内容”端附加一些文本。

我有(在内容方面)经典的门户标签:

我需要动态附加(通过重氮)另一个标签(#numbers)的内容以获得类似的内容:

如何解决这个问题?谢谢

0 投票
1 回答
466 浏览

plone - 如何将 portlet 移动到内容的 #content 区域?

我想即时修改内容,以便稍后将修改后的版本输入主题的内容槽。用例将日历portlet 定位在collective.cover 行/列/单元格中。

这是我尝试过的:

0 投票
1 回答
204 浏览

plone - 重氮取代标签与

我在使用重氮进行克隆时遇到问题。

我的页面模板中有 <esi:include> 标签,但是当我使用 diazo 时,所有这些标签都会被 <include> 替换,即使我是否使用 mode="raw" 也是如此。

我发现了一个丑陋的解决方法:

但是当 html 以 mode="raw" 放置时,<include> 标签不会被 <esi:include 替换。

任何想法?

非常感谢。

0 投票
0 回答
75 浏览

plone - 用 esi 克隆重氮

是否可以避免在使用重氮渲染页面时将 doctype、<html>、<head>、<body> 添加到页面中?

我的问题是,当 varnish 从 <esi:include src="/mypage"> 标记加载内容时,diazo 会将 <!DOCTYPE、html 头和正文标记添加到加载的页面。我只想拥有“/mypage”给出的html。

谢谢!

0 投票
3 回答
375 浏览

json - 带有 json 属性错误的重氮主题:“属性 'data-plugin-options': 无法编译表达式”

我有一个静态主题,其中包含一些用于自定义 jquery 插件的 json 属性,例如

重氮编译器抱怨这个像

并打破渲染。

有没有办法使这项工作(除了将 conf 移动到 js 之外)?