typo3 - Give a class to specific Page in Main Menu in Typo3
问题描述
I want to achieve having a menu with 2 levels, and some should always be expanded - some shouldn't. Is there any way I can hand over a class or something, if possible set up in the backend, to be able to choose which menu links should be expanded?
For example:
- Menu Link 1 with no subitems
- Menu Link 2 with subitems expandable (sublinks only visible on click)
- Menu Link 3 with subitems always expanded (sublinks always visible)
- Sub link 1
- Sub link 2
解决方案
通常,您需要向链接或li
标签添加一个类,以便 CSS 或 javascript 可以决定哪些部分是可见的。
一个类似的问题是根本不呈现某些子菜单,但是由于您希望这些子菜单在单击时可见,因此无论如何都必须呈现它们。所以这只是如何将这些信息放入渲染菜单的问题。它应该是一个可以改变可见性的标志。这可以用 CSS 和 javascript 来完成。
您可以在记录中存储此信息,pages
您可以在其中使用任何其他未使用的字段(例如layout
)。实现取决于您生成菜单的方式。
同时,您有两种选择:
- 经典:带排版
- 流体:菜单处理器
使用这两个选项,您可以将类添加到 JS 可以处理的菜单项。
推荐阅读
- amazon-web-services - 用户连接到另一个用户作为朋友关系 - AWS GraphQL 转换
- character-encoding - 如何在 BizTalk AS2 接收中使用“引用打印”内容传输编码?
- mysql - 无法获取特定用户组的资产负债表。我该怎么做
- php - 将自定义表单中的数据保存在 wordpress 数据库中
- ios - Facebook SDK:UINavigationController 没有成员“推送”
- reactjs - 在 React props 中解构 ES6
- python-3.x - For 循环中带有过滤器 boto3 的快照 id
- java - 使用线程时并发 RejectedExecutionException
- excel - 如何复制行并将它们粘贴到给定单元格值的工作表中
- javascript - Chart.js 压缩条形图上的垂直轴