Drupal 4.6.1, Node keywords 4.6.0

1) Metatags keywords and description are shown to those only who have a permission to administer node keywords. Since anonymous users such as search engines (main auditory of these metatags) are not given this permission they do not see them in the source.

If we grant this permission to the anonymous user, the following problem appears:

2) All pages that contain the list of nodes with their description (such as the front page of the site) contain as many meta keywords and descriptions as many nodes they list.

For example, on my front page I have 7 nodes listed; so in the source there are 7 sets of meta-keywords and meta-descriptions... The search engines (those that scan matatags) will surely take it as abuse and ban the site.

These two bugs make it absolutely impossible to use this module from 4.6.0 package. This is why a marked these bugs as critical.

CommentFileSizeAuthor
#3 nodewords_0.patch2.83 KBRobrecht Jacques
#1 nodewords.module.txt5.04 KBxbc

Comments

xbc’s picture

StatusFileSize
new5.04 KB

I'd made a small refinement.

1. make the meta entry visible to anonumous
2. solve the problem of premature closing in content=" text " if the text contains double quote (")
3. make the text more impact by removing \n and whitespaces

I hope it is useful to those using nodewords.

birukoff@drupal.org’s picture

Well, I tried and found that it really makes keywords and description visible to anonymous users.

But, sitewide keywords still duplicate, and on the front page keywords and descriptions still appeare separatelly for every node listed there.

???

Robrecht Jacques’s picture

Status: Active » Needs review
StatusFileSize
new2.83 KB

Attached is a patch which includes the changes of xbc (but in a patch format) and fixes the duplicated sitewide keywords and fixes the multiple meta-tags on the front page.

  1. keywords and description are checked and filtered so no quotes (") or html appears in them;
  2. anonymous users can see the keywords and description tags (no "administer node keywords" permission is needed);
  3. only one keywords meta-tag will appear:
    • on a node page this is the local keywords (if present) + sitewide keywords (if present);
    • on a node listing page only the sitewide keywords (if present) appear.
  4. only one description meta-tag will appear:
    • on a node page this is the teaser (if present);
    • on a node listing page this is the site-mission (if present).
  5. sitewide keywords are not duplicated.

On a node listing page (eg the front page), only one keyword meta-tag appears. This will only list the global keywords. I suppose it is possible to concatenate all keywords of all nodes the page lists (will need some coding), but I don't think this is preferable. One might disagree.

birukoff@drupal.ru’s picture

Excellent!!!

:)

Robrecht Jacques’s picture

Assigned: Unassigned » Robrecht Jacques
Status: Needs review » Fixed

Fixed in CVS-HEAD and DRUPAL-4-6.

druvision’s picture

Title: Two bugs that make the module completely invalid » Valid description & keyowrds for category pages

The description on taxonomy category pages should be the category description. And the keywords list should only contain one keyword: The category name.

This is a must. Repeating the site mission in so many pages might be considered spam.

druvision’s picture

Version: 4.6.x-1.x-dev »
Status: Fixed » Active

Changing the status to active and version to cvs

Robrecht Jacques’s picture

Fixed in CVS-HEAD:

- on taxonomy pages (q=taxonomy/term/XXX), the description is set to the description of the vocabulary.
- site-mission isn't used anymore if no description is set.

I'm not sure about the keyword thing. In CVS I would like to start using folksonomy (need to check it out) and when that is the case, setting keywords to the category name makes sense. I don't know if it makes sense now.

Can you check CVS-HEAD to see if there are remaining issues?

druvision’s picture

1. I've tested your latest fix. You still give the same description (vocabulary description) for all terms in the same vocabulary. It should be the description of the term, and not the description of the vocabulary (as your latest code).

2. Regarding keywords: I've read the folksonomy posts. A term page is a alwasy a keyword-focused page, where the keyword is the term name. You can safely inject the term name into the meta keywords tag. Folksonomy is neatly integrated into the current vocabulary system. You may simply mark a vocabulary as freetagging-enabled. Even when we have folksonomy integrated, it is simply another vocabulary, with freetagging turned on. True, it will be possible to tag a node with folksonomy tags, but it does't effect taxonomy term pages.

druvision’s picture

Additional information regarding description (Item 1 in my latest post):

  • I think we should only use the first 250 characters of the term description, because search engines love short descriptions.
  • I think we should strip the HTML.

Additional information regarding keywords (Item 2 in my latest post):

  • Folksonomy tagging is just for nodes, not for categories. It is done by using freestyle taxonomy categories.
  • Taxonomy pages *are* the categories. Therefore they won't be categoried, nor tagged.

Just add the term name as the keyword.

Robrecht Jacques’s picture

OK, a number of fixes, hope I got it right now:

1. I've tested your latest fix. You still give the same description (vocabulary description) for all terms in the same vocabulary. It should be the description of the term, and not the description of the vocabulary (as your latest code).

Right. I've misread your earlier remark. Now it uses the term description on those pages. Note: the global keywords are inserted too on those pages, that is the definition of these global keywords I believe.

BTW: if you have an URL like "taxonomy/term/1,2,3", the page lists all nodes that have all of these terms. So on such pages, I don't put a description, but I do include all keywords in the meta-keywords. The same with a OR-query ("taxonomy/term/1+2+3").

  • I think we should only use the first 250 characters of the term description, because search engines love short
  • descriptions.

    Yes. Problem is though, where to cut off. I can cut off on word boundaries, but then you are not sure there is still a valid sentence. So for a description made from the teaser, there could be some problems. This will be easier once I have added the seperate description field where I can do some validation so it is shorter than 250 chars.

    I'll think on how to add this.

  • I think we should strip the HTML.
  • I think we do. No? If there is HTML in the keyword or description meta-tag, then this is a bug. Please report it (with an example of html tags not stripped, eg in a term description, site mission of teaser).

    2. Regarding keywords

    You are right. On taxonomy pages ("taxonomy/term/XXX"), the term name can be inserted in meta-keywords.

    As for folksonomy. This is just a vocabulary as another. I will add to "nodewords - settings" an option to use a specified (folksonomy enabled?) vocabulary instead of an input box for keywords. This doesn't change anything to the term pages, you are right.

    Thanks for your input. Straightened my thinking of keywords :-)

    Please check CVS-HEAD to see if everything is fixed now concerning keywords.

    druvision’s picture

    I have checked the category pages and they now work great!

    Note: the global keywords are inserted too on those pages, that is the definition of these global keywords I believe.

    It works great now. Of course I don't mind the added global keywords - it's only an option.

    I can cut off on word boundaries

    Yes, please cut it off on word boundaries. Cutting off on word boundaries seems enough for both humans and robots.

    As for folksonomy. This is just a vocabulary as another. I will add to "nodewords - settings" an option to use a specified (folksonomy enabled?) vocabulary instead of an input box for keywords.

    This is a great idea - I've opened a separate issue for auto-node-keywords. I think it will solve the folksonomy issue as well.

    druvision’s picture

    Status: Active » Fixed
    druvision’s picture

    I am reopening the issue - there was last issue still left open from your last post. You wrote:

    This will be easier once I have added the seperate (per-term?) description field where I can do some validation so it is shorter than 250 chars. I'll think on how to add this.

    Adding a description field for taxonomy terms is indeed an issue I haven't thought about.
    The current vocabulary-term description field can contain atribatary HTML, pictures, IMG tags, etc... To my client's request,

    I've even turned it into an HTMLArea editor. This causes problems with the tooltip of the category link, which is now full with junk HTML (for example, see the tooltips on the rightside menu of Traffic-Law, an amazing Hebrew site based on my ongoing Drupal Hebrew translating project).

    A separate description field per vocabulary term is an idea worth investigating. This field may be used for tooltips and for nodewords. But this issue need the involvement of the taxonomy module as well.

    druvision’s picture

    Priority: Critical » Normal
    Status: Fixed » Active
    Robrecht Jacques’s picture

    Category: bug » feature

    Having junk HTML in the title of links is a bug that should be reported to either the theme you are using, or to the module responsable for making this menu of links.
    I'm not totally sure if one is supposed to use such a long text in the "title" attribute of a link though. I thought that "title" attribute was used to provide a more readable link text. Eg: if you have a link "click here", then you need to put a title like "Interesting report of nodewords usage patterns". If you just see the "title", you know what the link is about. Putting a whole text, even with tables and images, is not the purpose of "title".
    Is this "title" attribute something you have put in your theme or does it work like that with plain Drupal?

    A seperate meta-description would solve this too of course. I'm not sure if the necessary hooks are available though... Let's start with a normal description for nodes first and see how it goes from there :-)

    druvision’s picture

    Priority: Normal » Minor

    Separating the term teaser from the term description is an issue which should seemingly be opened for the taxonomy module - it is common to all taxonomy based module.

    Modules like taxonomy_dhtml use the term description for the title (tooltip) while other modules (e..g taxonomy_context) put it in the term page.

    The junk HTML is not a bug. My client entered HTML which is valid for the per-term pages. And indeed, the per-term pages look very nice, with tons of HTML and images. The problem is that this text is automatically used for the tooltips, and tooltips don't like HTML. This HTML is currently stripped so that it doesn't break the code (e.g.   instead of blank), but it is still not nice.

    I agree with you that this is lower priority.
    I may try to open an issue later for the taxonomy module.

    Robrecht Jacques’s picture

    Separating the term teaser from the term description is an issue which should seemingly be opened for the taxonomy module - it is common to all taxonomy based module.

    Modules like taxonomy_dhtml use the term description for the title (tooltip) while other modules (e..g taxonomy_context) put it in the term page.

    The junk HTML is not a bug. My client entered HTML which is valid for the per-term pages. And indeed, the per-term pages look very nice, with tons of HTML and images. The problem is that this text is automatically used for the tooltips, and tooltips don't like HTML. This HTML is currently stripped so that it doesn't break the code (e.g. instead of blank), but it is still not nice.

    I don't understand much Hebrew (nothing in fact), but if I see a tooltip as:

    <p><strong>קנסות משטרה </strong>...
    (at least that is what I see using FireFox)

    is just wrong. It is valid html, but it doesn't make sense or at least it isn't how it should look. The html isn't stripped at all, it is escaped. A < is replaced by &lt; that's it. The tooltip itself should look like:

    קנסות משטרה ...

    Nothing more, nothing less.

    (hope I didn't offend anyone with the Hebrew I copied)

    What "taxonomy_dhtml" should do is "strip_tags" to get rid of any html in the description of the term, and then "check_plain" to quote anything that needs quoting in order to be put inside title="...". Now it seems to do only 'check_plain' - you could report that as a bug in "taxonomy_dthml" I believe.
    "taxonomy_context" on the other hand is doing the right thing. It displays (possible-)HTML on a place where HTML is allowed.

    I agree that your client has the right to enter HTML on the description so the term page has a nice image, links, etc. But as a tooltip, it should be plain text.

    I'll look at this after I finished the description for node thingy. Should be ready later this evening.

    Robrecht Jacques’s picture

    An update:

    it is possible to add form elements to a "edit vocabulary page" (taxonomy/edit/vocabulary/XXX) and to a "edit term page" (taxonomy/edit/term/XXX), so adding a meta-tag specific description (or whatever) is possible. Only in CVS version of taxonomy.module though, not in 4.6.

    This feature will be implemented in the next couple of days.

    Robrecht Jacques’s picture

    I think this is feature is implemented in the current CVS-HEAD:
    - a term can have a description (+abstract+copyright, but no keywords obviously)
    - a vocabulary can have a description (+abstract+copyright, but no keywords obviously)

    Please read README.txt carefully as the database scheme has changed (again) to allow for this.

    Can you see if this fixes this issue?
    Thanks.

    Robrecht Jacques’s picture

    Status: Active » Fixed
    Anonymous’s picture

    Anonymous’s picture

    Anonymous’s picture

    Status: Fixed » Closed (fixed)