Closed (fixed)
Project:
Metatag
Version:
8.x-1.x-dev
Component:
Panels integration
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
5 Sep 2015 at 10:45 UTC
Updated:
8 Aug 2018 at 14:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
damienmckennaPostponing until Panels is ready.
Comment #3
damienmckennaPanels / Page Manager is probably good enough at this point to do the work.
Comment #4
danieka commentedHi Damien,
Thank you for your work with Metatag. Do you have any gut feeling of how long this might take, are you working on it actively or is it more of a "it's done when it's done"-situation?
Cheers Daniel
Comment #5
damienmckennaThanks Daniel :) I don't have any gut feelings about when I might get to this. I'd honestly really like it if someone would work on a patch to add the necessary functionality as I've not had a chance to look at Panels for D8 at all and would have no clue where to start.
Comment #6
kevinvb commentedI worked on a patch to support page variants. The config entity type of page manager.
That way it supports panels and block pages as wel.
I needed this functionality so I could add metatags to overview pages and custom page manager pages.
Its a submodule for metatag with a dependency on page manager.
I had to change a line in the MetatagDefaultsForm save function because config entities don't support bundles and otherwise the form would throw undefined index warnings.
Be free to test it out and maybe use it as a base for further improvements.
Best approach would be to include a metatag api which enables other modules to add their entity to the metatag types.
And in the save and hook page attachements a entitystorage load would be needed to support any entity.
Comment #7
kevinvb commentedComment #8
al0aLooks like this patch works. Might need some documentation.
Comment #9
kevinvb commentedReadme is not included in the submodule because the module extends the metatag module.
To configure page variants defaults you can simply follow the instructions of the metatag module.
Comment #10
dobrzyns commentedMetatagDefaultsForm.php has since been changed, so the above patch no longer applies.
This UI seems unintuitive. Looking at the current structure around panels pages, the entity bundle is the panels page level and the entity type is the variant level. Should not the default settings (MetatagDefaultsForm) be at the panels page (bundle) level, not the variant (type) level? I would think then that the variant level would be set through the panels page UI (tab under each variant). If memory serves me right, this is how it was done in the D7 version.
Comment #11
dobrzyns commentedI've attached a patch using the current UI that accounts for the changes to
MetatagDefaultsForm.php.Comment #12
dobrzyns commentedComment #13
kevinvb commentedIndeed due to metatag 11 release my patch didn't work anymore.
@dobrzyns thanks for the changes your patch works again.
Comment #14
damienmckennaWill look into this after 1.0 is released.
Comment #15
damienmckenna8.x-1.0 is out, so this is fair game again.
Comment #16
youfei.sun commentedHmm, I can't make #11 nor #6 patch to work for beta-11 nor 1.0.
I've applied the patch, and enabled the metatag_page_variants module, but the metatag option is not appearing in the page manager.
Comment #17
kevinvb commented@youfei.sun you have to go to /admin/config/search/metatag when you add a new default all page variants should be available as a type to create a new metatag default.
The patch is just a first approach to make metatag available for page variants. It should indeed be nice if a extra section becomes available in the page manager configuration.
Comment #18
dobrzyns commentedIt appears that this work was committed and this issue can be closed.
Comment #19
damienmckenna@dobrzyns: No, it hasn't been committed yet.
Comment #20
damienmckennaThis needs some tests to a) help make sure it works as intended, b) help prevent regressions from future changes.
Comment #21
dobrzyns commented@DamienMcKenna: Yes, sorry about that. Docker-sync unison stopped working on me, and I didn't realize.
Comment #22
minneapolisdan commentedI applied the patch from #11 and it worked great.
Comment #23
kevinvb commentedI also still am using the patch from #11 and it works great.
Thanks for making the changes so it is compatible for the 8.1 release of metatags!
Comment #24
ryan.ryan commentedJust a minor update to the path in #11 for submodule category and description.
Comment #25
dawehnerI had to improve the label this patch introduces in the backend, see screenshot.
Otherwise, at least for my simple usecase, it worked.
Comment #26
kunalkursija commentedI have used the patch #24, And it worked fine.
Comment #27
plopescHere is a small new iteration of this patch, improving a bit the readability of the Metatag Defaults list page when having multiple page variants.
Thank you!
Comment #28
kunalkursija commentedTried #25, That adds the labels in options list But after defaults are added the UI does not show the labels.
However, this problem is solved by #27 & that looks much neat.
Just a minor thing, The patch namein #27 should have comment id 27 and not 26 :)
Comment #29
peter.keppert commentedI have added implementations of these hooks:
hook_metatag_alter()
hook_metatag_route_entity()
to latest patch version. Without this, metatag_get_tags_from_route() does not work correctly for Page Variants.
Comment #30
bgronek commentedSo it looks like this has matured a bit. Is anything still needed to get it committed?
Comment #31
damienmckennaTests.
Comment #32
plopescHere are some tests for this integration.
While working on this, I renamed the module to "Meatatag Page Manager" instead of "Metatag Page Variants", as I believe it is more intuitive.
Thank you.
Comment #33
plopescAttaching the actual patch :)
Comment #34
kaushashah commentedI have applied the patch of #33 & it is working fine. Thanks for this.
Comment #35
igalafate commentedIt appears #33 can not be applied anymore after updating Metatag from 8.x-1.3 to 8.x-1.4. Does anyone else have this problem?
Comment #36
piggito commentedAs mentioned by @isaura the patch in #33 is not properly applying in current 8.x-1.x branch so I'm rerolling it.
Comment #37
PascoS commentedI have applied patch #36 on metatag 8.x-1.4 and it won't work. It change nothing, i'm not able to modify my metatag on a custom pages, nothing changed on the pages option nor on metatag module. Even if I have succesfully installed Metatag Page Manager.
Have I missed something ?
Edit : Understood thanks to #17.
Comment #38
PascoS commented#36 installed and work well on 8.x-1.4
How can we deal with the page manager metatag in different language ? As it look to do the same for all language with the patch ?
Comment #39
rybchynski commentedOn 8.x-1.4 version #36 is working perfect.
Thanks a lot.
Comment #40
kevinvb commentedGreat to see that this issue keeps being patched.
@DamienMcKenna Any idea about the future of this issue? Will this ever be taken into a stable release of Metatag?
Comment #41
rybchynski commentedOn 8.x-1.4 #36 is working perfect. Thanks a lot.
Comment #42
damienmckennaNow that there are tests I'm really excited about committing this :-)
At this point I just need to manually test it out.
Comment #43
fuzzyjared commentedAfter applying Patch #36 on existing site with MetaTag configured I receive an error.
It is a relatively new development site so I uninstalled metatag and then tried to install it together but the same error was triggered.
Comment #44
markandrewsuttonI've installed this patch and generally it is working great. I'm noticing one issue, however, that I can't seem to figure out.
My Page Variant is a sub-path of a taxonomy term, and I want to use the term tokens in my variant metatags. Variant has the taxonomy_term parameter in its path and I'm able to get *most* of what I need with the help of
hook_metatag_route_entity(). If I enter a term token into a field in my variant metatag config, it works as expected.But the strange thing is that when I try to combine tokens and text in the variant metatag config, the tokens do not get replaced. For example:
`[term:name]` works
`[term:name] and some other text` does not. the token just gets stripped out.
I've tried to manually handle this by replacing the tokens myself using
hook_metatags_alter()* and I can even see the output I want when debugging, but that output is getting overwritten after the alter hook.Anybody else experience anything like this?
*In this scenario, I am not using
hook_metatag_route_entity(), since it overrides the entity type, which is what it's supposed to do.Comment #45
plopescRe-rolling again.
Thanks!
Comment #47
scotthooker commentedYour patch in 45 misses a , inside composer.json
Comment #48
scotthooker commentedComment #49
amy.h commentedI don't see anywhere in the admin area where you can edit the page manager / panels metatags. Where is the ability to do this located? I'm on version 1.4
Comment #50
amy.h commentedSorry just realized this patch was never officially committed
Comment #51
pieterdcHaven't checked why comment 48 exists but started from comment 47 because that is meant to be a fix of comment 45 which is meant to be a reroll of the most recent patch with a successful test run.
The patch in comment 47 misses a line in the patch for the part of composer.json
Fix attached.
Comment #52
damienmckennaOk, I finally took a look through this. There's one concern - the configuration should be stored with the page manager configuration like how the Views integration works, not separately.
Comment #53
damienmckennaPer nikathone's comment in Slack, this needs the D8 equivalent for hook_page_manager_variant_operations_alter to build out a custom plugin to show a tab/subpage for each page variant.
Comment #54
damienmckennaPer @eclipsegc:
Comment #55
kevinvb commented@DamienMcKenna,
Adding the configuration to the page manager configuration would mean that both metatags and page variant structure configuration are stored in one config export .yml file?
If so I'm not sure if this is a good approach, this would have the same problem as in Drupal 7 in which page structure and content are exported into one. Giving either the content contributor not the chance to edit the metatags without it being reverted by features (D7) / CMI (D8) or giving developers a headache trying to separate metatags configuration from the page variant.
What's your opinion?
Comment #56
damienmckenna@KevinVb: This is how the Views integration works, I see no reason to store them differently.
Comment #57
grayle commentedThe reason KevinVb gave? If anything, the Views integration should be changed to store its metatag config separately (in a separate issue of course), but don't ruin this patch by doing the same thing as was done with Views. At least if they're stored separately people can ignore that config to give clients a chance to fill in metatags as they see fit without those changes being reverted every so often. If they're one and the same, that option is taken away for no good reason.
This was already a problem in 7 when using Features, don't make it a problem in 8 too just because.
Comment #58
damienmckennaThe global defaults are already a configuration entity, you still have to manage it via the config management system.
Comment #59
grayle commentedMetatag node type defaults aren't part of the node type config object, they're a separate config object. The same logic should apply to Views and Page manager variants. They're still configuration, but because they're a separate config object developers can use config_ignore to, well, ignore it.
Clients don't care or understand that some pages are nodes and others are page manager pages and others still are Views pages. It's a page, and they want to manage their metatags and not have their changes be reverted when configuration gets synchronized.
Comment #60
damienmckennaI've thought about this and I agree with the this approach. I've opened a new issue to split the Views configuration into its own object: #2981549: Separate Metatag configuration from Views definition.
What I'm not sure about is whether the per-module configurations should be on their own admin page or part of the main configuration page..
Comment #61
yohanaraujo07@gmail.com commentedThe module worked as expected with the pages I created via Page Manager
Comment #62
nikathoneFYI I also came across https://www.drupal.org/project/metatag_routes which I was able to use to create metatag for pages created through page manager.
Comment #64
damienmckennaCommitted. Thank you all!
FYI there are some outstanding issues related to changing the UI for this functionality (#2988154: Allow meta tags to be configured from within Page Manager UI) and the Views configuration structure (#2981549: Separate Metatag configuration from Views definition), some help with those would be appreciated.