Add a template for field accordion in content types ( node ) to use the Accordion component

Created on 26 May 2024, about 1 month ago

Problem/Motivation

The accordion component is working on the block and we need to create a default component for nodes

Steps to reproduce

1- Create a content type
2- Add field paragraph [field_accordion] and use the current paragraph items
3- Render the field

{% set accordion_items = [] %}
{% for accordion_item_paragraph in items %}
  {% set accordion_item_header = accordion_item_paragraph.content['#paragraph'].field_title.value %}
  {% set accordion_item_body = {
    '#type':   'processed_text',
    '#text':    accordion_item_paragraph.content['#paragraph'].field_body.value,
    '#format':  accordion_item_paragraph.content['#paragraph'].field_body.format,
  } %}
  {% set accordion_item_expanded = (accordion_item_paragraph.content['#paragraph'].field_expanded and accordion_item_paragraph.content['#paragraph'].field_expanded.value == true) ? true : false %}

  {% set accordion_item = {'header': accordion_item_header, 'body': accordion_item_body, 'expanded': accordion_item_expanded } %}
  {% set accordion_items = accordion_items|merge([accordion_item]) %}

{% endfor %}

{% include "varbase_components:accordion" with {
  title_tag: 'h2',
  heading: label,
  items: accordion_items,
} %}

β†’

Proposed resolution

Remaining tasks

  • βœ… File an issue about this project
  • ❌ Addition/Change/Update/Fix to this project
  • ❌ Testing to ensure no regression
  • βž– Automated unit/functional testing coverage
  • βž– Developer Documentation support on feature change/addition
  • βž– User Guide Documentation support on feature change/addition
  • βž– UX/UI designer responsibilities
  • βž– Accessibility and Readability
  • ❌ Code review from 1 Varbase core team member
  • ❌ Full testing and approval
  • ❌ Credit contributors
  • ❌ Review with the product owner
  • ❌ Update Release Notes and Update Helper on new feature change/addition
  • ❌ Release

Varbase update type

  • βœ… No Update
  • βž– Optional Update
  • βž– Forced Update
  • βž– Forced Update if Unchanged

User interface changes

  • N/A

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

  • N/A
✨ Feature request
Status

Needs work

Version

3.0

Component

Code

Created by

πŸ‡―πŸ‡΄Jordan Ahmad Abbad Jordan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024