1

I'm currently using DataGrab to pull a WP blog into EE. It works for the most part, but I can't seem to get tags to work?

I added the Wordpress datatype to DataGrab (http://brandnewbox.co.uk/products/datatypes) and I see the "tags" section is looking for domain="tag", which the WP export has? Trying to get it to populate DevDemon Tagger field, but when checking import it looks like it's not seeing the tags at all?

Any suggestions greatly appreciated!!


EDIT: So I managed to get Wordpress tags pulled in by modifying the Wordpress datatype for DataGrab. Don't remember the line number, but for tags it's looking for domain="tag"but Wordpress exported it as domain="post_tag", so once I updated that I was able to get tags in. However, DataGrab still doesn't work with Tagger. So I could only import the tags into a text field, and then go into Tagger and import from the field.

This still doesn't completely solve the problem. Now the tags are in Tagger, but no longer attached to the post. So they're basically useless :(

Any thought/ideas on how to ge things re-attached in an automatic way? With 1,000's of post I'm not willing to go through and manually re-assign!


EDIT 2: I've since tried to use Solspace Tag as an alternative to see if it would work, unfortunately it does not. With DevDemon Tagger no error was returned, with Solspace Tag however I receive a php error:

Message: Undefined index: allow_subloop
Filename: fieldtypes/datagrab_tag.php

So still trying to figure this out. There are post on the DataGrab forum about this as well, so I know I'm not alone: http://brandnewbox.co.uk/forums/viewthread/858/, I also submitted my own post here: http://brandnewbox.co.uk/forums/viewthread/927/

I will update this post if I manage to get a solution figured out...

1

DataGrab doesn't currently have support for the Tagger field type.

However DataGrab does have support for Solspace Tag which may provide the correct functionality for you without having to manually update.

Tag isn't free, but Solspace offer a 30-day money back guarantee so if it doesn't work you should be able to get a refund.

http://www.solspace.com/software/detail/tag/

| improve this answer | |
  • I thought of that as well, and purchased Solspace tag to try out, it still doesn't work. I get an error: Undefined index: allow_subloop. See post on DataGrab forum here: brandnewbox.co.uk/forums/viewthread/927 – shparkison Jun 7 '14 at 18:23
  • Thanks for updating Shaun. If Brand New Box's support fix their Tag support, could you come back and let us know please? – Mutual Jun 8 '14 at 14:24
  • Yes, I most definitely will. That's part of my frustration with this, within my searches I've come across this and it seems they always have a fix, yet email the person and no info is left for the rest of us looking around aimlessly for a solution. I will definitely be back to post a solution if one is found... – shparkison Jun 8 '14 at 15:40
1

The developer of DataGrab emailed me the solution. I figured I would post it here so that anyone else who may have this problem down the road is able to solve it!

First, you need to update the Wordpress plugin as described in my original post. Then copy this bit of code and save it as "datagrab_tagger.php" and place inside the DataGrab "fieldtypes" folder:

<?php

/**
 * DataGrab Tagger fieldtype class
 *
 * @package   DataGrab
 * @author    Andrew Weaver <aweaver@brandnewbox.co.uk>
 * @copyright Copyright (c) Andrew Weaver
 */
class Datagrab_tagger extends Datagrab_fieldtype {

    function prepare_post_data( $DG, $item, $field_id, $field, &$data, $update = FALSE ) {

        $data[ "field_id_" . $field_id ]["tags"] = array();

        // Can the current datatype handle sub-loops (eg, XML)?
        if( $DG->datatype->datatype_info["allow_subloop"] ) {

            // Check this field can be a sub-loop
            if( $DG->datatype->initialise_sub_item( 
                $item, $DG->settings["cf"][ $field ], $DG->settings, $field ) ) {

                // Loop over sub items
                $tags = array();
                while( $subitem = $DG->datatype->get_sub_item( 
                    $item, $DG->settings["cf"][ $field ], $DG->settings, $field ) ) {

                        $tags[] = $subitem;

                    }
                    $data[ "field_id_" . $field_id ]["tags"] = $tags;

                }

        }

    }

}

?>

This will allow you to import Wordpress tags into DevDemon Tagger!

| improve this answer | |
  • This didn't work for me without also updating the exp_tagger_links table with the correct field_id. – James Smith Oct 23 '14 at 10:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.