Problem/Motivation

When using a Textfield widget there is no preview in Display Builder which can get easily fixed by implementing a settingsSummary method. WYSIWYG is doing that as well.

Before After

User interface changes

The preview will show the text that was entered.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

yannickoo created an issue. See original summary.

yannickoo’s picture

Status: Active » Needs review
grimreaper’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the issue and MR.

Looks good to me.

just_like_good_vibes’s picture

Status: Reviewed & tested by the community » Needs work

hello guys, MR pipeline is red, please correct before we
can merge :)

mogtofu33 made their first commit to this issue’s fork.

mogtofu33’s picture

CI failing is not related to the code in this MR, will see if I can fix it, but probably a new branch is required.

mogtofu33’s picture

Status: Needs work » Needs review

Some changes for review, use Symfony to truncate and htmlentites for textfield, because it should not receive html tags and this highlight them. Added truncate and strip_tags to token.

yannickoo’s picture

Great, thanks for this! Do you think we should only show 20 characters? It seems like we have enough space on one row, so maybe we could think about increasing that.

mogtofu33’s picture

30 was a bit too much for Display Builder in Layers panel, could be fix by the css there but so I thought 20 is good enough, with the Builder panel we have the whole content.

just_like_good_vibes’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

mogtofu33’s picture

Assigned: Unassigned » mogtofu33
Status: Fixed » Needs work

Strangely we lost the Token summary, I will try to investigate

mogtofu33’s picture

Ok, Token source do not extend SourcePluginPropValue but directly SourcePluginBase, should we move the default summary there?

mogtofu33 changed the visibility of the branch 3563204-implement-settings-summary to hidden.

mogtofu33 changed the visibility of the branch 3563204-settings-summary-rebase to hidden.

mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Needs work » Needs review
just_like_good_vibes’s picture

token may be deprecated soon, now that we have token support here and there.
the code we already merged in that Issue is only for certain sources, right :)
we cannot move now that code to the source plugin base class, and assume there will be a value.
let's discuss this soon

mogtofu33’s picture

As discussed moved back to prop and added on token.

just_like_good_vibes’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.