The label seems like an unnecessary step in the pattern form, but the key part is creating a machine name ID. If I put on a site-builder hat, it feels confusing what I should put here, since the entity type + condition summary does a pretty good job of being the 'label' in reality (and likely would duplicate what most people put for labels). Maybe we should get rid of label and just have a machine_name field?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Reid created an issue. See original summary.

Dave Reid’s picture

Title: Possible to auto-fill the label? » Is label necessary for patterns?
toomanypets’s picture

Yeah, just ran across this. I have no idea what to enter for label.

Berdir’s picture

I don't see how just having a machine name would make it easier for site builders? I don't think we can generate a machine name out of the pattern or the selection, the second at least not without quite a bit of custom JS code I suppose.

Moving the label at the bottom was an experiment that I did when building that form in the first place, so you can select what the pattern is before you have to think about a label.

I'm not sure about completely removing it. We did generate labels also for the upgrade path, so it is possible. However, there we had a simple pattern with one entity type + maybe a bundle + maybe a language. What if you select 3 node types?

Maybe we could have a bit of JS that suggests a label based on the selection, I'm sure we can also improve the UI texts and descriptions, a description like "Provide a short description of this pattern to be able to identify it again later" might also help users already? And the label could make it clearer that it is just an administrative label, shown only in the backend.

It's not so different from a label for a View, a Page Manager page and many other config entities.

bojanz’s picture

I must admit that I too had no clue what to enter for the label.

EDIT: To clarify this, I'm not saying that means the label should be removed. If we have a machine name, then we should also have a label. It would just make sense to provide a description, an example, the explanation that its for admin purposes only, etc. Autogenerating the label would probably be too magical.

joachim’s picture

> It would just make sense to provide a description, an example, the explanation that its for admin purposes only, etc.

+1 to this.

I was a little bit thrown by the label, but not massively.

LpSolit’s picture

Title: Is label necessary for patterns? » In the pattern edit form, a description should explain what the label is used for
Assigned: Unassigned » LpSolit
Status: Active » Needs review
FileSize
611 bytes

I also agree that the label should stay. It's easier to find the pattern later. But a description would help to understand what the label is used for.

joachim’s picture

Thanks for the patch!
The first sentence of description looks perfect to me. I'm not so sure about the bit about 'content type' in the second though -- don't pathauto patterns apply to things that aren't nodes?

LpSolit’s picture

FileSize
486 bytes

The 2nd sentence was just an example. Here is another patch with the first sentence only.

  • Berdir committed f0152a8 on 8.x-1.x authored by LpSolit
    Issue #2705553 by LpSolit: In the pattern edit form, a description...
Berdir’s picture

Status: Needs review » Fixed

Thanks.

Status: Fixed » Closed (fixed)

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