Hello!

I'm trying to import some simple HTML-Files. The problem is, that the code from the example templates doesn't work for me.
There is always just the first letter imported. For example the first keyword is Drupal, then just the letter D is imported, no other keywords. Same with the description.
I use nodewords.

For the reason, that I need just the keywords and the description to be imported I think it must be possible to catch this more directly?
Unfortunately I'm so familiar with XSL. So anybody does have a hint for me?

CommentFileSizeAuthor
#6 metatag.txt692 bytesliquidcms

Comments

dman’s picture

I found this too.
It seems the internal data structure of nodewords changed sometime recently, going from a flat string to an array. This is why it's not only saving the first character of the string.

This is fixed in -dev. You can if you like just replace your copy of nodewords.inc with the updated version

ab2211’s picture

Thanx for your answer!

Sorry, but the given links don't work and I can't find a nodewords.inc in the dev-package.

EDIT: The nodewords.inc is in the dev-package of Import HTML. My mistake.

No success with the dev-version of nodewords.inc.

raven_web’s picture

I too am having this issue. When I import html files, I get only the first letter of the meta tags inserted into the nodewords meta tags. I have tried it with both Import HTML 6.x-1.1 and 6.x-1.x-dev, along with Nodewords 6.x-1.11.

raven_web’s picture

Found a solution... note: this is for 6x-1.x-dev

I don't know how to write a patch, so if someone else can that would be great, but here is what worked for me:

In import_html_process.inc remove lines 154-156:
if (module_exists('nodewords')) {
$node->nodewords['description'] = $value;
}

In nodewords.inc (in import_html/modules) change line 18 from:
$node->nodewords['description']['value'][] = $node->description;
to:
$node->nodewords['description']['value'] = $node->description;

liquidcms’s picture

Title: How to import meta keywords and meta decription » Metadata for D7
Version: 6.x-1.0 » 7.x-1.x-dev
Category: support » bug

bumping this to D7.

nodewords module has changed to the metatag module in D7 and import_html is still looking for the old D6 module.

I will look at adding patch for this if someone doesn't beat me to it. I thought just renaming nodewords.inc to metatag.inc and a couple other minor changes would work; but will require a bit more work.

the import_html hook in my new renamed metatag.inc file is being hit; but at first glance i see that the meta data is not available in $node to assign to anything. perhaps i have not been able to find a setting to enable meta data parsing?

liquidcms’s picture

StatusFileSize
new692 bytes

adding this file (metatag.inc) to import_html/modules (and might as well remove the nodewords.inc that is there as it does nothing) adds back metadata import support.

note: rename .txt to .inc

liquidcms’s picture

Status: Active » Needs review
dman’s picture

Status: Needs review » Reviewed & tested by the community

Bravo - that submodule support hadn't been reviewed or tested in the D7 upgrade. The upgrade for some of the extras/contrib was automated only. To the point that it didn't cause new errors.
It hadn't been revisited since the module rename from nodewords.
I'm glad that the modularity worked as designed and was concise enough to upgrade to keep up with API changes so simply.
Good job.
I'll certainly push this contribution in and ... yeh, remove the old one for the D7 branch.

dman’s picture

Status: Reviewed & tested by the community » Fixed

Committed #7. http://drupalcode.org/project/import_html.git/commit/29a4610
Sorry for the delay, I've not been taking time to clean up some loose ends here.
Should be good.
Thanks for the contrib!

teschek’s picture

I'm commenting on this post because my own posts aren't being answered, and I have no idea why. Am I doing something wrong? dman, can you please look at my posts and help me out?

Status: Fixed » Closed (fixed)

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