U4-10742 - Support core property editors in Nested Content label templates

Created by Kenn Jacobsen 10 Dec 2017, 10:50:06 Updated by Sebastiaan Janssen 24 Jul 2018, 14:16:46

Tags: PR

When using property editors that do not contain simple text values in Nested Content label templates, the labels look rather bad. In my concrete example I've used a richtext editor in the label template, which results in the entire text (including escaped HTML tags) being applied as the label template (see the attached screenshot).

I suspect when using a content picker in the label template, the result would be the ID of the picked content - not the name, which would be reasonable to expect (disclaimer: I haven't tested this).

I suggest that:

Label templates should be truncated to a reasonable text length to avoid labels breaking the layout.

HTML tags should be stripped from the label templates.

All (supported) built-in property editors should be supported in label templates, e.g. resulting in the picked content name when using a content picker property as label template.

I realize that I can code my way out of this by creating my own angular filters to format the label templates (and I have done just that), but it seems to me that this is a general issue that should be solved in the core.

For the actual implementation there is a lot of inspiration to find here: https://github.com/kgiszewski/Archetype/blob/c22a2623c2d9d3e1c100db954f6f550aca06965e/app/services/archetypeLabelService.js#L187

1 Attachments


Dave Woestenborghs 27 Mar 2018, 13:43:15

Hi @post@kennjacobsen.dk

Content pickers are already supported in the core by using ncNodeName filter (this was added in nested content 0.4)

See docs of nested content : https://github.com/umco/umbraco-nested-content/blob/develop/docs/developers-guide.md#name-template

I just created a PR so it can also be used on media and member pickers for this issue : http://issues.umbraco.org/issue/U4-11154


Kenn Jacobsen 27 Mar 2018, 13:48:05

Hi @dawoe

I already did a PR which includes media, members and a few more... :)


Dave Woestenborghs 27 Mar 2018, 13:50:30

I did not notice that one. I see we solve things differently in the ncNodeName filter.

Kenn Jacobsen 27 Mar 2018, 13:53:49

Yeah the UID contains the type explicitly :)

Dave Woestenborghs 27 Mar 2018, 13:58:22

But that does not work for pickers still using integer id's

Kenn Jacobsen 27 Mar 2018, 14:00:45

Nope; you can't create those pickers anymore.

Dave Woestenborghs 27 Mar 2018, 14:03:12

Upgraded sites still have them. And possibly community packages as well.

Sebastiaan Janssen 24 Jul 2018, 14:16:31

I'll set this to "Fixed" even though it might not address ALL of the issues. It is a great improvement already and we can always create more issues to deal with the things missed here. :-)

Priority: Normal

Type: Bug

State: Fixed


Difficulty: Normal


Backwards Compatible: True

Fix Submitted: Pull request

Affected versions:

Due in version: 7.12.0


Story Points: