The group by option is not available for accordion settings in 8.x-4.x as it is for 8.x-3.x (via patch). I went ahead and took that patch and modified it to work with 8.x-4.x for the sake of completeness. I'll generate a patch to attach to this post once I have the id number to use.

Comments

dmdewey created an issue. See original summary.

dmdewey’s picture

chegor’s picture

The patch is working with 8.x-4.3.
But not sure if it's a working idea to use the grouping field as "Panel title field".

odai jbr’s picture

StatusFileSize
new2.07 KB

A re-roll for the patch. version 8.4.x-dev

shelane’s picture

Version: 8.x-4.x-dev » 5.4.x-dev
teknocat’s picture

I think there's definitely a use case for wanting to use the grouping field as the panel title instead of a panel title field.

While that could be done by overriding the template (which I will do in conjunction with this patch since I have that specific use case), it would be ideal if the options form allowed you to choose which way you wanted it to be displayed - the groups as accordions, or the rows within the groups as accordions.

In my case, I want the groups to be accordions. I could also use some other view format, such as unformatted list or something, and then write a template for that that uses bootstrap accordions. It would just be nice if it could all be done easily with this module.

teknocat’s picture

Actually after making that comment and then digging a bit deeper, I realised it's not quite that simple as the parent view template would have to take care of the accordions in the case of wanting each group as an accordion. I'm therefore not sure if this can be achieved with this module. I think it would be necessary to use some other formatted like unformatted list and override all the appropriate templates needed to make that function as accordions by group.

stevenlafl’s picture

@teknocat

I am one such individual. For example, let's say I want to have the panel title by "Year" but it's grouped, so that articles which were published on that year show up in a list inside the panel.

This gets me to that goal. However we need to incorporate it with some new settings for Views.

<div id="{{ id }}" class="card">
  <div class="class-header" id="heading{{ key }}">
    <h5 class="mb-0">
      <button class="btn btn-link" data-toggle="collapse" data-target="#{{ id }}-collapse-{{ key }}" aria-expanded="false" aria-controls="collapseOne">
        {{ group_title }}
      </button>
    </h5>
  </div>

  <div id="{{ id }}-collapse-{{ key }}" class="collapse" aria-labelledby="heading{{ key }}" data-parent="#{{ id }}">
    <div class="card-body">
    {% set i = 0 %}
    {% set len = rows | length %}
    {% for key, row in rows -%}
      {% set i = i + 1 %}
      {{row.content}}
    {%- endfor %}
    </div>
  </div>
</div>
bunthorne’s picture

Can this also be added to the 5.x version?