Drupal 8 - 创建一个手风琴领域 [英] Drupal 8 - creating an accordion field

查看:30
本文介绍了Drupal 8 - 创建一个手风琴领域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Drupal 8 中——我想修改基本页面内容类型以支持手风琴字段类型"

In Drupal 8 -- I want to modify the basic-page content type to be able to support an "accordion field type"

我已经看到了列表字段类型 - 可以有无限的字段 - 但我正在寻找一种解决方案,可以提供 - 标题/正文 - 类型功能.

I've seen the list field type - that can have unlimited fields -- but I am looking for a solution that can feature -- header/body - type features.

推荐答案

没有模块可以为你处理这个问题,解决办法是在你的内容类型中创建无限制的实体引用,它必须有两个字段,TitleBody 根据需要,并将其转换为手风琴,您应该自定义新的实体字段主题并在那里实现手风琴.

There is no module to handle this for you, the solution is to create unlimited Entity Reference in your content type, it must have two fields, Title and Body as you want, and to convert it to accordions you should customize new entity field theme and implement accordion there.

另一个解决方案是,通过https://www.drupal.org/project/views_bootstrap 支持手风琴或 https://www.drupal.org/project/faqfield模块:

Another solution is, handle it by https://www.drupal.org/project/views_bootstrap which support accordion or https://www.drupal.org/project/faqfield module :

Features:
Configurable default text formats
Configurable answer widget
Types: Normal textareas, textfields and formatable textareas
Formatable textareas for any Wysiwyg editor
Configurable number of rows for textarea widget
Field formatters
jQuery Accordion UI
Simple themeable text
Definition list (HTML <dl>)
Anchor link list
Accordion display options
Choose first active question
Collapse open questions
Event to open/collapse questions (eg. mouseover, click)

这篇关于Drupal 8 - 创建一个手风琴领域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆