typo3 - TYPO3:是否可以在项目符号列表组件的描述中包含链接?
问题描述
使用 Typo3 8.7.19,我被要求在页面内包含一组文档/视频的链接,所以我考虑了一个描述列表。每个标题都是链接的标题,而描述是应该呈现为的实际链接
<a href="http://something.linky" rel="noopener noreferrer">http://something.linky</a>
所以所有的东西都应该变成这样
<dl>
<dt>A title for this link</dt>
<dd><a href="http://something.linky" rel="noopener noreferrer">http://something.linky</a></dd>
</dl>
查看文档,在这个组件上,每个描述都应该像
Term 1|Description 1
Term 2|Description 2
Term 3|Description 3
但我不确定是否有任何方法可以使用此架构包含链接,或者我是否必须求助于使用默认文本组件。
解决方案
当您编辑流体模板时,这是可能的。
首先外包默认的流体模板。
然后编辑此模板:
Partials/Bullets/Type-2.html
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:ce="http://typo3.org/ns/TYPO3/CMS/FluidStyledContent/ViewHelpers" data- namespace-typo3-fluid="true">
<f:if condition="{bullets}">
<dl class="ce-bullets">
<f:for each="{bullets}" as="definitionListItem">
<f:for each="{definitionListItem}" as="termDescription" iteration="termDescriptionIterator">
<f:if condition="{termDescriptionIterator.isFirst}">
<f:then>
<dt>{termDescription}</dt>
</f:then>
<f:else>
<dd>{termDescription}</dd>
</f:else>
</f:if>
</f:for>
</f:for>
</dl>
</f:if>
</html>
只需添加一个
<f:format.html>{termDescription}</f:format.html>
大约
{termDescription}
然后你可以把它写在描述列表中。
Term1 | <LINK 1>Your description</LINK>
Term2 | <a href="http://something.linky" rel="noopener noreferrer">http://something.linky</a>
推荐阅读
- javascript - 使用 Javascript 获取长文本文件切片的更好方法
- python - Python:AttributeError:'set'对象没有属性'values'
- project-reactor - 发布不同对象类型的 FluxSink
- django - 如何在同一个基于类的视图中传递两个模板
- android - 如何在颤动中制作依赖的多级下拉菜单?
- intershop - 订单创建添加了不需要的运输桶
- c++ - 是 operator<(HANDLE, HANDLE) 或 std::less 之一
定义明确? - typescript - React Native/TypeScript/Testing Library/Jest 的设置不起作用
- c# - 子表单始终在 Win Forms 中的父表单前面
- node.js - 使用 mongodb 获取带有 $box 的文档,并为具有特定坐标点的每条记录添加距离字段