Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Module Metatag released and working now (but alpha).
I think support migrate SEO data to Metatag fields very usefull for all.
Any patch yet?
Comment | File | Size | Author |
---|---|---|---|
#32 | metatag-n1284756-32.patch | 340 bytes | DamienMcKenna |
#29 | metatag-n1284756-29.patch | 2.45 KB | DamienMcKenna |
#20 | 1284756-20.patch | 889 bytes | dsdeiz |
#15 | 1284756-15.patch | 1.59 KB | damiankloip |
#14 | 1284756-14.patch | 1.58 KB | damiankloip |
Comments
Comment #1
nod_I think it's a duplicate #1312982: Meta tags support
Comment #2
lancee CreditAttribution: lancee commentedComment #3
jantoine CreditAttribution: jantoine commented@lancee,
Could you provide an example of how to use this your metatag.inc file? I can't figure out how to use MigrateDestinationHandlers.
Thanks!
Comment #4
dsdeiz CreditAttribution: dsdeiz commentedHi, would like to try my hands on this but was wondering if I'm correctly setting the tags. When doing a
node_save()
, should the property$node->metatags
containarray('description' => array('value' => $description), 'keywords' => array('value' => $keywords));
? Was wondering cause when I checked the table that metatags created, it contains a serialized data and when I unserialize it, I got that array. This is what I have when I tried to implement it.Comment #5
alanburke CreditAttribution: alanburke commentedWorking code in this one, so reopening, and set the other as the duplicate.
Patch attached - thanks for the code.
Comment #6
alanburke CreditAttribution: alanburke commentedPatch attached
Comment #7
mikeryanThis would best go into the Meta tags module itself. This patch would need the following changes:
1. Add metatag_migrate_api().
2. Rename metatag.inc to metatag.migrate.inc, so hook_migrate_api() can be found automatically.
3. Add metatag.migrate.inc to location.info.
Comment #8
DamienMcKennaThanks guys.
Leaving this as Needs Work as it also should use the APIs to identify which meta tags are available rather than hardcoding a few specific ones.
Comment #9
DamienMcKennaComment #10
mjvandermeulen CreditAttribution: mjvandermeulen commented@alanburke
An example is needed to understand how to use your patch #6
I'm in the same boat as AntoineSolutions:
Comment #11
sylus CreditAttribution: sylus commentedHere is an updated patch that doesn't use hardcoded values and seems to work fairly well in testing.
Only problem noticed is that can't see to set title metatag as conflicts with title field. Custom Metatags work as expected.
Comment #12
DamienMcKennaAck, the page title problem sucks. I'm somewhat tempted to rename that metatag to "page_title" internally..
Comment #13
Manovra76 CreditAttribution: Manovra76 commentedFor node all it's ok, but migrate metatag in term.....not work. no message, nothing. Any idea?
Comment #14
damiankloip CreditAttribution: damiankloip commentedI have cleaned up this patch a bit and removed some stuff we don't need.
I'm not sure what I'm missing with the title issue? This seems to be working OK for my purposes so far.
Comment #15
damiankloip CreditAttribution: damiankloip commentedOops, sorry. A working one.
Comment #16
DamienMcKennaCommitted! Good work, everyone!
Comment #18
dsdeiz CreditAttribution: dsdeiz commentedHi! For the registerTypes bit, perhaps this can be used?
This way custom entities can be supported. Also I think there's a type in metatag.api.php:
Oh, and I think the classes are encouraged to be explicitly registered on 2.5 so I guess
metatag_migrate_api
becomes:Comment #19
DamienMcKenna@dsdeiz: Thanks for noticing my #facepalm-worthy typo, I've added a new issue to handle the fix: #1886170: 'metatag'=TRUE incorrect in metatag.api.php
Comment #20
dsdeiz CreditAttribution: dsdeiz commentedPatch attached for the changes for #1284756-18: Support Migrate module for importing data into Metatag.
Comment #21
dsdeiz CreditAttribution: dsdeiz commentedComment #22
DamienMcKennaCommitted, thanks dsdeiz.
Comment #23
robbertnl CreditAttribution: robbertnl commentedIs an example already available? Do you have to use another MigrateDestination for metatags?
For now i am just doing an dbmerge in my complete function of my import class, which uses MigrateDestinationNode. Dirty, but it works.
Comment #24
DamienMcKenna1.0-beta6 is out, so I'm closing this issue in the interest of keeping the issue queue clean.
Comment #25
robbertnl CreditAttribution: robbertnl commented@#24 Does it include an example?
Comment #26
dsdeiz CreditAttribution: dsdeiz commentedHi!
You have one destination for every available metatag property (or metatag "fields" - not sure what they're called). Here's an example of available fields/properties: https://www.evernote.com/shard/s276/sh/d0865c92-86ef-4fcf-bc54-a285d54a9...
It's then just a matter of mapping them e.g.:
Comment #27
DamienMcKennaLets reopen this to add some documentation about it.
Comment #28
dsdeiz CreditAttribution: dsdeiz commentedHi!
Here's a basic usage assuming the module name is
metatag_migrate
:metatag_migrate.inc:
metatag_migrate.migrate.inc:
Comment #29
DamienMcKennaThis puts dsdeiz's example code into the metatag.migrate.inc file as a comment, and adds a note to the features list in README.txt to mention to look there for full details of how to use the Migrate integration.
Comment #30
DamienMcKennaCommitted. Thanks for the example code, dsdeiz!
Comment #31
dsdeiz CreditAttribution: dsdeiz commentedI think it got overridden.
Comment #32
DamienMcKenna#facepalm moment - string replacement unchecked.
Comment #33
DamienMcKennaCommitted.
Comment #34
DamienMcKennaNow that v7.x-1.0-beta7 is out, I'm closing this in the interest of keeping the issue queue clean.