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

Flex-objects List view item template

Started by yyer 4 years ago · 2 replies · 655 views
4 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 1534 5 months ago
Forms & Blueprints · by Hugo Oliveira, 6 months ago
0 261 6 months ago
Forms & Blueprints · by Flachy Joe, 8 months ago
9 368 7 months ago
Forms & Blueprints · by Augustus, 8 months ago
7 363 8 months ago
Forms & Blueprints · by Julien, 8 months ago
10 394 8 months ago