Not getting any help in the main forum ( http://drupal.org/node/690982 ), so hopefully someone has an answer here?

We are running a couple of dozen sites off one installation of Drupal. One admin runs all the sites. There is no over-arching metadata. Each site has site-level metadata. Some of the nodes on each site need to have node-specific metadata. Thus, nodewords. It is installed, and indeed I can see a meta description showing up only where it ought. The problem is node-level metadata is being *appended* to site-level metadata, rather than replacing it. I want node-level metadata to replace site-level (or even overarching) metadata.

How do I do that?

I've tried flipping as many different settings on and off, in as many combinations and permutations as possible, and nothing seems to work.

Oh, and turning off the site level metadata -- which does cause the node-level metadata to appear alone, unappended -- is not an option because then every page but the one in question would be meta-less.

Comments

damienmckenna’s picture

I'll be glad to help :)

Please confirm my reading of your problem: you set the default meta tags and you set some on a specific node, when you view that node it outputs *both* the default meta tags *and* the node's meta tags, leading to duplicate tags?

Preston McMurry’s picture

Essentially, yes. (Though the node-level tag is different than the site-level tag.)

Thanx for the quick response!

damienmckenna’s picture

Category: support » bug

I'm sorry you're running into this bug. I'll try to look into it this weekend and will see what I can find out.

Preston McMurry’s picture

Category: bug » support

I don't know if it is a bug, or simple unfamiliarity. I'm trying to learn Drupal, but am finding it very difficult, so it is likely something I am unaware of, rather than a bug. Some flag or something I am not setting, or something like that.

I have description and keywords checked on admin/content/nodewords/settings , both to show on edit forms and in HTML. (The latter being why the node description does show up.)

I also looked at admin/build/domain/conf/{siteID} and node/{nodeID}/edit , but no matter what I try, I cannot get it to work how I want, for all the pages, at the same time.

Preston McMurry’s picture

Heck, it even inserts a comma between the site and node descriptions:

<meta name="description" content="BEGIN SITE-WIDE DESCRIPTON : #1 online resource for blah blah blah : END SITE-WIDE DESCRIPTON ...
,node-specific description" />

Everything between content=" and the carriage return actually is part of the site description. Everything after the comma is part of the node description.

-----

edit: Not sure why I was using an alias. switched to real name.

edit 2: This appears to be a different issue than http://drupal.org/node/1293494 and http://drupal.org/node/1331564 in which the complaint was that the site meta was overwriting node meta. My complaint is node meta is appended to site meta, rather than overwriting site meta.

Perhaps there should be some sort of switch to indicate which has precedence (site or node), and how (overwrite, append, or prepend).

damienmckenna’s picture

Could you please paste in an example of the meta tags that are displayed on a node? Thank you.

damienmckenna’s picture

Version: 6.x-1.13 » 6.x-1.x-dev
Status: Active » Fixed

I tested the current codebase and this does not seem to be a problem:


<meta name="dc.title" content="dc.title" />
<meta property="og:title" content="og:title" />
<meta name="description" content="description" />
<meta name="dc.description" content="dc.description" />
<meta property="og:description" content="og:description" />
<meta name="abstract" content="abstract" />
<meta name="keywords" content="keyword1,keyword2" />
<meta name="dc.date" content="2012-04-30T00:00:00Z" />
<meta name="dc.contributor" content="Joe Monkey" />
<meta name="dc.contributor" content="Monkey Joe" />
<meta property="og:type" content="website" />
<link rel="canonical" href="http://drupal6.local/monkey" />
<meta property="og:url" content="http://drupal6.local/monkey" />
<meta name="revisit-after" content="1 day" />

I set the defaults to say "not the [tagname]", e.g. "not the og:description", and on the node set them to just say "[tagname]", e.g. "og:description". As you can see, each tag is only output once (except for dc.contributor, and that's a new feature), so either the bug has been fixed or something funny was going on with your setup.

I'll be releasing the next version this week, please try it out :)

Preston McMurry’s picture

Actually, that is the exact clip from the generated HTML. :-) But here is the entire head:

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="/sites/default/themes/smartsearch/images/cancer/favicon.png" type="image/x-icon" />
<meta name="description" content="BEGIN SITE-WIDE DESCRIPTON : #1 online resource for blah blah blah : END SITE-WIDE DESCRIPTON ...
,node-specific description" />

	<title>Foo Corp Information and News | Foo Corp/title>

	<script type="text/javascript" src="/misc/jquery.js?l"></script>
<script type="text/javascript" src="/misc/drupal.js?l"></script>
<script type="text/javascript" src="/sites/default/modules/contrib/google_analytics/googleanalytics.js?l"></script>
<script type="text/javascript" src="/sites/default/modules/contrib/webform/js/webform.js?l"></script>
<script type="text/javascript" src="/sites/default/themes/smartsearch/js/libs/modernizr-2.0.min.js?l"></script>
<script type="text/javascript" src="/sites/default/themes/smartsearch/js/script.js?l"></script>

<script type="text/javascript">
<!--//--><![CDATA[//><!--
jQuery.extend(Drupal.settings, { "basePath": "/", "googleanalytics": { "trackOutgoing": 1, "trackMailto": 1, "trackDownload": 1, "trackDownloadExtensions": "7z|aac|arc|arj|asf|asx|avi|bin|csv|doc|exe|flv|gif|gz|gzip|hqx|jar|jpe?g|js|mp(2|3|4|e?g)|mov(ie)?|msi|msp|pdf|phps|png|ppt|qtm?|ra(m|r)?|sea|sit|tar|tgz|torrent|txt|wav|wma|wmv|wpd|xls|xml|z|zip" } });
//--><!]]>
</script>
	<link type="text/css" rel="stylesheet" media="all" href="/sites/default/files/css/css_a5701df3a4907dbc2e0c290cf22a53dc.css" />
  <!--[if lt IE 8]> <link type="text/css" rel="stylesheet" media="all" href="/sites/default/themes/smartsearch/css/ie7.css" /> <![endif]-->
</head>

p.s. I will! Thanx for being so quick to respond. :-)

p.p.s. - Set the defaults where? There's over-arching metadata (forget where it is), site-level metadata (i.e. admin/build/domain/conf/{siteID}) and node-level metadata (i.e. node/{nodeID}/edit).

damienmckenna’s picture

Ah, I see what you mean, it's appending the node description onto the end of the site-wide default description.

Please test out the current -dev version, it doesn't exhibit that behavior.

Preston McMurry’s picture

I am a Drupal n00b, so hang in there ... I downloaded the -dev a few hours ago. I just now finished installing it. (I was trying to following the update module instructions at http://www.youtube.com/watch?v=XkyLke7Uj6I .) Not sure if you've updated the -dev since I grabbed it this morning? In any case, without changing anything else in my setup, or changing the settings on any node (or anything else), I refreshed my test node. Editing out the other head elements, it now looks like this:

<meta name="description" content=",node-specific description" />

<meta name="description" content="BEGIN SITE-WIDE DESCRIPTON : #1 online resource for blah blah blah : END SITE-WIDE DESCRIPTON ..." />

In other words, the site description is still there, except now it is as a second meta tag.

I tried putting [tagname] in the node's meta description instead -- I am probably misunderstanding the instruction -- and basically got the same result:

<meta name="description" content=",[tagname]" />

<meta name="description" content="BEGIN SITE-WIDE DESCRIPTON : #1 online resource for blah blah blah : END SITE-WIDE DESCRIPTON ..." />

That appears to be the case regardless of browser.

-----

edit: I downloaded -dev again, and did a diff of nodewords_basic.module with no differences, so it appears I have the most recent -dev version.

Preston McMurry’s picture

Noticed another dev release this morning. Grabbed the "May 29, 2012 - 12:28" .zip file. Went through the module update process. Without doing anything else other than refreshing the public-side test node in question, it seems I am back where I was before the May 28th -dev release:

<meta name="description" content="BEGIN SITE-WIDE DESCRIPTON : #1 online resource for blah blah blah : END SITE-WIDE DESCRIPTON ...
,node-specific description" />
damienmckenna’s picture

Status: Fixed » Active

Do you have any other modules that provide meta tags? Do you have any custom modules that could be using the APIs to modify things?

damienmckenna’s picture

Status: Active » Closed (works as designed)

As it happens, this is a feature of Domain Meta :)