- Issue created by @naveenvalecha
- First commit to issue fork.
- Merge request !171Issue #3498656 by naveenvalecha: Custom Meta tags: Allow - in the machine name of the tag. β (Open) created by naveenvalecha
- π¨π¦Canada sagesolutions
The PR looks like it can handle
<meta name="format-detection" content="telephone=no">
now which is great. Can you also update it so colons are allowed? In my case I need to addtwitter:data1
meta tags - πΊπΈUnited States DamienMcKenna NH, USA
Thank you for working on this.
In hindsight I think we should have transparently converted the name of the meta tag from a user entered string to something for the machine name, to avoid situations where meta tag names just don't match the limitations of the machine name logic.
That said, thank you for the improvements.
A few minor nitpicks:
$form['id'] = [ '#type' => 'machine_name', + '#maxlength' => 64, + '#description' => $this->t('A unique name for this custom tag. Must be alpha-numeric, hyphen, or underscore separated.'),
+ protected function createCustomMetaTag($id, $label, $description, $htmlElement, $htmlNameAttribute, $htmlValueAttribute) { + // Access custom meta add page. + $this->drupalGet('admin/config/search/metatag/custom-tags/add'); + $this->assertSession()->statusCodeEquals(200); + $edit = []; + $edit['id'] = $id; + $edit['label'] = $label; + $edit['description'] = $description; + $edit['htmlElement'] = $htmlElement; + $edit['htmlNameAttribute'] = $htmlNameAttribute; + $edit['htmlValueAttribute'] = $htmlValueAttribute; + $this->submitForm($edit, 'Save'); + $this->assertSession()->addressEquals('/admin/config/search/metatag/custom-tags'); + $this->assertSession()->pageTextContains('Created Format Detection Custom tag.'); + }
The pageTextContains() check has the name of one meta tag hardcoded, it should check for the $label.
This would be accommodated in π¬ Creating custom meta tag Active
- Status changed to Closed: outdated
about 2 months ago 1:19pm 17 March 2025 - π«π·France musa.thomas France π«π·
adding temporary patch allowing colons ":" inside machine name, waiting the relataed issue to be resolved
- π«π·France musa.thomas France π«π·
Ok it seems there is a problem wiith the config entity to have colons inside theire name. So it would be better if we can split the machine name of config and also the real name of the tag?