Skip to content
This repository was archived by the owner on Jan 6, 2022. It is now read-only.
This repository was archived by the owner on Jan 6, 2022. It is now read-only.

Cannot display properties from SnippetChooserPanel in titleTemplate #46

@roodie

Description

@roodie

I have a very simply structblock:

class MemberRoleBlock(BaseBlockMixin, blocks.StructBlock):
    member= SnippetChooserBlock(target_model='members.Member', required=True)
    role = blocks.CharBlock(required=False)

    @property
    def definition(self):
        definition = super(PersonRoleBlock, self).definition
        definition['titleTemplate'] = "${member}"
        return definition

... but I have to display the name of the member as the title when the block is collasped. The problem is that the value for member at this stage is the id. Is there any hack, monkey patch, really, any solution to get the actual member.name field displayed as the title? I am completely stuck.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions