Referring to Item name in default item widget

I have a small problem with configuring the default (list) item widget:

How is it possible to refer to the underlying Item name in an expression?

In the configuration dialogue, it is mentioned that …

Note: the parameter named ‘item’ will be set automatically with the name of the item (cus5) unless it’s set explicitely.

I have the following YAML for the list item widget

value: ""
  badge: badgetext
  footer: =items[props.item+"_cycles"].state
  subtitle: subtitle
  tooltip: tooltip
  header: header
  after: =props.item
  title: =vars.item

but neigher props.item nor vars.item returns the item name (which in this case is cus5).

I think it’s just item. No quotes, no = in front, not props. or vars..

I’m afraid, it isn’t … This …

value: ""
  badge: =items[item].state
  footer: =items[item+"_e"].state
  subtitle: item
  tooltip: tooltip
  header: header
  after: =props.item
  title: =item

gives me that …

The way I always do it is to use the props object. You just have to declare the property at the start of the widget just as usual and make sure that you set the context of the property to item. That property will then be autoset by the UI with the name of the item.

Hey Justin,
Thanks for that. This does - of course - work… I was just wondering, whether I could have gotten away without defining a new widget and just configuring a default (system) widget and using some of the underlying f7 properties.

Ah, I think I understand the question now. To my knowledge this is not feasible.

If you are just configuring one of these items via the metadata then it’s no more difficult to type the item name directly into the configuration than it is to type a variable and if you’re configuring multiple items it’s almost certainly to your benefit to make it a custom widget anyway (for example, if you decide on a change and only have to change one widget instead of each individual declaration).