Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Forms & Blueprints

Flex-objects List view item template

Started by yyer 3 years ago · 2 replies · 573 views
3 years ago

Is there a way to customize flex objects list view using item twig templates?
Suppose we have a "contacts.yaml" blueprint with the following list view part:

YAML
# List view
list:
  title: name
  fields:
    published:
      field:
        type: toggle
        label: Publ
      width: 8
    last_name:
      link: edit
    first_name:
      link: edit
    friends:
      field:
        label: Number of Friends
        template: '{{ friends|length }}'

I would like to see a number of "friends" in the last data-column. The field "friends" has a list type. But the above code does not work for me. The "template" setting is ignored. Is it impossible? Help me, please.

👍 1
3 years ago

@Alexander I suppose there is no possibility to define own templates for normal list view items rihgt now. There is just a template property for the title field. However, I have a similar need for this feature right now.

Maybe anyone else has an idea for this issue?

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by Ton Haarmans, 5 years ago
13 1135 4 months ago
Forms & Blueprints · by Hugo Oliveira, 5 months ago
0 61 5 months ago
Forms & Blueprints · by Flachy Joe, 6 months ago
9 134 6 months ago
Forms & Blueprints · by Augustus, 7 months ago
7 108 7 months ago
Forms & Blueprints · by Julien, 7 months ago
10 128 7 months ago