Closed (fixed)
Project:
Metatag
Version:
7.x-1.x-dev
Component:
Documentation
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
20 Sep 2011 at 07:52 UTC
Updated:
22 Apr 2013 at 14:45 UTC
Jump to comment: Most recent file
Comments
Comment #1
nod_I think it's a duplicate #1312982: Meta tags support
Comment #2
lancee commentedComment #3
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 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->metatagscontainarray('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 commentedWorking code in this one, so reopening, and set the other as the duplicate.
Patch attached - thanks for the code.
Comment #6
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 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 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 commentedFor node all it's ok, but migrate metatag in term.....not work. no message, nothing. Any idea?
Comment #14
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 commentedOops, sorry. A working one.
Comment #16
damienmckennaCommitted! Good work, everyone!
Comment #18
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_apibecomes: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 commentedPatch attached for the changes for #1284756-18: Support Migrate module for importing data into Metatag.
Comment #21
dsdeiz commentedComment #22
damienmckennaCommitted, thanks dsdeiz.
Comment #23
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 commented@#24 Does it include an example?
Comment #26
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 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 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.