Problem/Motivation

In some case, when i build a component, i want to define "static" string value in a slot.
I don't have textfield widget for a slot, the only thing closed is wysiwyg, but i don't want wysiwyg, only a string value.

Steps to reproduce

From UI, create a component, and try to add a string value to a slot.

Proposed resolution

Add textfield available for slot prop types.

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

goz created an issue. See original summary.

pdureau’s picture

Status: Active » Postponed (maintainer needs more info)

hi Goz,

I use "Token" source usually to achieve that, without putting a token as value of course. Maybe we can rename "Token" source as "String" knowing there is a token processor running on its value?

goz’s picture

Title: Allow to use textfield source widget as slot prop type » Rename token source

Nice, it works !

Agreed to rename token source, but replacing Token by String, we are missing the "token" feature.
May be something with both ?
"String and token" ?

pdureau’s picture

Status: Postponed (maintainer needs more info) » Active

"String and token" may be too long. But I don't have a better proposal.

just_like_good_vibes’s picture

we could mention the token capabilities in the description and keep string as source name.
but, be careful, tokens can return renderables, yes they are like UFOs right? so string may not be accurate.
let’s check that, maybe i am wrong

pdureau’s picture

but, be careful, tokens can return renderables, yes they are like UFOs right? so string may not be accurate.
let’s check that, maybe i am wrong

Very interesting! If tokens can returns renderables, that mean the current list of prop types is wrong:

  prop_types: ['slot', 'string', 'url'],

https://git.drupalcode.org/project/ui_patterns/-/blob/2.0.x/src/Plugin/U...

just_like_good_vibes’s picture

i need to check what is returned carefully…

just_like_good_vibes’s picture

Status: Active » Closed (won't fix)

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.