Please see issue: Description meta tag doesn't show - http://drupal.org/node/566530#comment-2006826.

This was an issue posted by me. I found the solution and the problem seems to be caused by the HTML Purifier module.

As a summary of this issue:
Installation and config of the HTML Purifier module interferes with the Meta tags module - the Description meta tag is not shown in certain content types.
Disabling and un-installation of the HTML Purifier module does not resolve the problem.

If you have any suggestions as to how I can config the HTML Purifier module to work with the meta tags module, that would be much appreciated.

Comments

ezyang’s picture

The meta tag is only permitted in head tags as per spec, so they are disallowed by HTML Purifier. Uninstalling HTML Purifier, however, should resolve the issue (you may have to clear some caches). The simplest way of making this work may be to define the meta tag. I don't understand the issue well enough to give any more specific advice, though: how does the Meta tags module work?

drupaloo-1’s picture

Hi ezyang,

Thanks for your very quick response.

Unfortunately I am not a developer and I don't have enough knowledge to answer your question about how the Meta tag module works from a code perspective.

All I can say is that the Meta tag module is able to programatically generate the "Description" Meta tag from the node teaser. This is critical for my site for search engine optimization. I have nodes created by users and this is a great way to show the teaser of a node in the "Description" Meta tag, which in turn means I can get Google to show the teaser in Google search results.

When you say to define the meta tag - is there a way in the HTML purifier module to not filter this tag out?

avpaderno’s picture

Category: bug » support
Status: Active » Fixed

Nodewords / Meta tags allows the user to define the meta tag content that appears in HTML HEAD tag; it has also the option to create the content of the meta tag from the node teaser. As version 6.x-1.0 of Nodewords is already reported to create problems with third-party modules when the option is enabled, I would guess the problem is with Nodewords, not HTML Purifier.

Considering this, I am changing the meta data of this report. Feel free to change them if you think it is not correct.

ezyang’s picture

The difficulty is that making the meta tag not get filtered out requires a little programmer know-how.

avpaderno’s picture

It is not clear why HTML filter would cause Nodewords to have an empty meta tag description. As there are already reports about the use of Nodewords together third-party modules, I would think that Nodewords version 6.x-1.0 is not generating the node teaser in the right way, especially because the module cannot use the normal function used to get the node teaser (otherwise there would be also the link Read more, which should not appear in the meta tag).

drupaloo-1’s picture

I would agree with you KiamLaLuno that the problem seems to be in Nodewords - the Nodewords developer confirmed this as well for my issue.

He indicates that he will be rewriting this part of the module.

In the meantime, though, is there a way to have the HTML Purifier module not filter out the Description meta tag (e.g. is there such a thing as a whitelist?), or is this happening because of the reported problems?

Thanks!

avpaderno’s picture

The difficulty is that making the meta tag not get filtered out requires a little programmer know-how.

It is not possible for a filter module to filter out the output of Nodewords; a filter module can just change the content of a node body, but the node body doesn't contain the meta tags generated by Nodewords.

drupaloo-1’s picture

Ok, got it.
Sorry for my lack of understanding of coding.

avpaderno’s picture

I would agree with you KiamLaLuno that the problem seems to be in Nodewords - the Nodewords developer confirmed this as well for my issue.

Actually, it happens that the Nodewords developer is still me, KiamLaLuno. :-)

The only workaround is not use the option Use the node teaser if the description meta tag is not set; that option will be removed from the future releases of the module.

ezyang’s picture

My best guess is that Nodewords is putting the meta tag inline when it shouldn't? And the developer is fixing it to not do that? In that case, yes, you'd have to wait to get it fixed.

avpaderno’s picture

My best guess is that Nodewords is putting the meta tag inline when it shouldn't?

Nodewords doesn't put the meta tags inline; it doesn't change the node body, but it could use the node teaser to populate the content of a meta tag (if it is said to do so).

drupaloo-1’s picture

Sorry KiamLaLuno got you mixed up with the other developer.

drupaloo-1’s picture

Thanks for explaining further.

For my CCK content type, the description meta tag generated from the teaser is:

<meta name="description" content="Overview Description:&amp;nbsp; Our recently renovated, 1600 sq. ft. home.......

So this does have some html in it and so now I can see why the HTML purifier takes it out.

drupaloo-1’s picture

Title: HTML Purifier module removes Description meta tag generated by Meta tag module » Meta tag module does not generate Description meta tag if HTML Purifier module is installed.

Having discussed this issue with the developers of both the HTML Purifier module and Meta tag module, it seems the issue is being created by the Meta tag module.

Hence I believe the original issue title:
HTML Purifier module removes Description meta tag generated by Meta tag module

is inaccurate.

Changing it to:
Meta tag module does not generate Description meta tag if HTML Purifier module is installed.

Status: Fixed » Closed (fixed)

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