Comments

DamienMcKenna created an issue. See original summary.

damienmckenna’s picture

Status: Active » Postponed

Postponing until Panels is ready.

damienmckenna’s picture

Title: Panels integration » Panels / Page Manager integration
Category: Task » Feature request
Status: Postponed » Active

Panels / Page Manager is probably good enough at this point to do the work.

danieka’s picture

Hi 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

damienmckenna’s picture

Thanks 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.

kevinvb’s picture

StatusFileSize
new5.17 KB

I 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.

kevinvb’s picture

Status: Active » Needs review
al0a’s picture

Looks like this patch works. Might need some documentation.

kevinvb’s picture

Readme 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.

dobrzyns’s picture

Status: Needs review » Needs work

MetatagDefaultsForm.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.

dobrzyns’s picture

I've attached a patch using the current UI that accounts for the changes to MetatagDefaultsForm.php.

dobrzyns’s picture

Status: Needs work » Needs review
kevinvb’s picture

Indeed due to metatag 11 release my patch didn't work anymore.
@dobrzyns thanks for the changes your patch works again.

damienmckenna’s picture

Status: Needs review » Postponed

Will look into this after 1.0 is released.

damienmckenna’s picture

Status: Postponed » Needs review

8.x-1.0 is out, so this is fair game again.

youfei.sun’s picture

Hmm, 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.

kevinvb’s picture

@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.

dobrzyns’s picture

Status: Needs review » Reviewed & tested by the community

It appears that this work was committed and this issue can be closed.

damienmckenna’s picture

@dobrzyns: No, it hasn't been committed yet.

damienmckenna’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

This needs some tests to a) help make sure it works as intended, b) help prevent regressions from future changes.

dobrzyns’s picture

@DamienMcKenna: Yes, sorry about that. Docker-sync unison stopped working on me, and I didn't realize.

minneapolisdan’s picture

I applied the patch from #11 and it worked great.

kevinvb’s picture

I 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!

ryan.ryan’s picture

Issue summary: View changes
StatusFileSize
new5.05 KB
new579 bytes

Just a minor update to the path in #11 for submodule category and description.

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new26.15 KB
new5.17 KB
new1.95 KB

I had to improve the label this patch introduces in the backend, see screenshot.

Otherwise, at least for my simple usecase, it worked.

kunalkursija’s picture

I have used the patch #24, And it worked fine.

plopesc’s picture

Here 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!

kunalkursija’s picture

Tried #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 :)

peter.keppert’s picture

StatusFileSize
new6.19 KB

I 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.

bgronek’s picture

So it looks like this has matured a bit. Is anything still needed to get it committed?

damienmckenna’s picture

Tests.

plopesc’s picture

Here 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.

plopesc’s picture

StatusFileSize
new11.49 KB

Attaching the actual patch :)

kaushashah’s picture

I have applied the patch of #33 & it is working fine. Thanks for this.

igalafate’s picture

It 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?

piggito’s picture

StatusFileSize
new11.51 KB

As mentioned by @isaura the patch in #33 is not properly applying in current 8.x-1.x branch so I'm rerolling it.

PascoS’s picture

I 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.

PascoS’s picture

#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 ?

rybchynski’s picture

On 8.x-1.4 version #36 is working perfect.
Thanks a lot.

kevinvb’s picture

Great 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?

rybchynski’s picture

On 8.x-1.4 #36 is working perfect. Thanks a lot.

damienmckenna’s picture

Now that there are tests I'm really excited about committing this :-)

At this point I just need to manually test it out.

fuzzyjared’s picture

After applying Patch #36 on existing site with MetaTag configured I receive an error.

Unable to install Metatag Page Manager, metatag.metatag_defaults.403, metatag.metatag_defaults.404, metatag.metatag_defaults.front, metatag.metatag_defaults.global, metatag.metatag_defaults.node, metatag.metatag_defaults.taxonomy_term, metatag.metatag_defaults.user already exist in active configuration.

It is a relatively new development site so I uninstalled metatag and then tried to install it together but the same error was triggered.

markandrewsutton’s picture

I'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.

plopesc’s picture

Issue tags: -Needs tests
StatusFileSize
new11.45 KB

Re-rolling again.
Thanks!

Status: Needs review » Needs work

The last submitted patch, 45: panels_page_manager-2563657-45.patch, failed testing. View results

scotthooker’s picture

StatusFileSize
new11.45 KB

Your patch in 45 misses a , inside composer.json

scotthooker’s picture

StatusFileSize
new11.19 KB
amy.h’s picture

I 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

amy.h’s picture

Sorry just realized this patch was never officially committed

pieterdc’s picture

Status: Needs work » Needs review
StatusFileSize
new11.48 KB

Haven'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.

damienmckenna’s picture

Status: Needs review » Needs work

Ok, 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.

damienmckenna’s picture

Per 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.

damienmckenna’s picture

Per @eclipsegc:

ok, so practically, I think the API you're asking for is missing. That being said, while it is DEFINITELY suboptimal, I think you can probably look at page_manager_ui_entity_type_build() and emulate what's happening there. I'd build a subclass of which ever wizard makes the most sense (probably variant) and add my step manually through that process.

kevinvb’s picture

@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?

damienmckenna’s picture

@KevinVb: This is how the Views integration works, I see no reason to store them differently.

grayle’s picture

The 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.

damienmckenna’s picture

The global defaults are already a configuration entity, you still have to manage it via the config management system.

grayle’s picture

Metatag 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.

damienmckenna’s picture

I'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..

yohanaraujo07@gmail.com’s picture

The module worked as expected with the pages I created via Page Manager

nikathone’s picture

FYI 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.

  • DamienMcKenna committed fcd93c2 on 8.x-1.x authored by KevinVb
    Issue #2563657 by plopesc, scotthooker, dawehner, ryanissamson, KevinVb...
damienmckenna’s picture

Status: Needs work » Fixed

Committed. 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.

Status: Fixed » Closed (fixed)

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