Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Add weight to metatag_context.
Reason: we have support of wildcard in metatag_context, so, for example we have, we can have pathes:
/path-to-something/parh/*
/path-to-something/parh/page1
/path-to-something/parh/page2
/path-to-something/parh/page3
...
/path-to-something/parh/pageN
or even more complex structures.
We can add one global rule of metatags for all pages:
/path-to-something/parh/*
And special rule for page1:
/path-to-something/parh/page1
Parametr weight will be used for applying of the rule, which we need.
Comment | File | Size | Author |
---|---|---|---|
#8 | metatag_context-add-weight-2497043-8.patch | 4.86 KB | marcelovani |
#5 | Screen Shot 2016-01-07 at 17.52.13.png | 92.54 KB | marcelovani |
#5 | Screen Shot 2016-01-07 at 17.51.34.png | 48.95 KB | marcelovani |
#1 | metatag-weight-for-metatag-context-2497043-1.patch | 2.84 KB | uzlov |
Comments
Comment #1
uzlov CreditAttribution: uzlov at Skilld commentedComment #2
uzlov CreditAttribution: uzlov at Skilld commentedComment #3
DamienMcKennaComment #4
DamienMcKennaThanks. I'm not going to include this in the 1.5 release as I need to test it out a bit and consider how Context handles its definition selection.
Comment #5
marcelovaniHere is my solution:
Added the weight to the context UI
The weight is shown when you view the list of contexts by path on admin/config/search/metatags/context
Weight added to the context edit
Weight added to the context by path list
Comment #6
marcelovaniSimplified sorting
Comment #7
marcelovaniI forgot to commit the logic to reorder the contexts on the way out. Attaching patch.
Comment #8
marcelovaniRe-rolled the patch
Comment #9
DamienMcKennaCommitted. Thank you both!