| 1 |
; $Id: README.txt,v 1.29 2009/10/23 10:44:43 kiam Exp $
|
| 2 |
|
| 3 |
This module allows you to set some meta tags for each node.
|
| 4 |
|
| 5 |
Giving more attention to the important keywords and/or description on some of
|
| 6 |
your nodes allows you to get better search engine positioning (given that you
|
| 7 |
really only provide the keywords which exist in the node body itself, and do
|
| 8 |
not try to lie).
|
| 9 |
|
| 10 |
This version of the module only works with Drupal 6.x.
|
| 11 |
|
| 12 |
Features
|
| 13 |
------------------------------------------------------------------------------
|
| 14 |
Some features include:
|
| 15 |
|
| 16 |
* The current supported meta tags are ABSTRACT, CANONICAL, COPYRIGHT,
|
| 17 |
GEO.POSITION, DESCRIPTION, ICBM, KEYWORDS, PICS-LABEL, REVISIT-AFTER, ROBOTS
|
| 18 |
and the site verification meta tags used by Google Webmaster Tools,
|
| 19 |
Microsoft Bing Webmaster Center, Yahoo! Site Explorer.
|
| 20 |
|
| 21 |
* You can tell "nodewords" to add all terms of some specified vocabularies
|
| 22 |
to the KEYWORDS meta tag.
|
| 23 |
|
| 24 |
* You can specify a default meta tag ROBOTS value to use for all pages. You can
|
| 25 |
override it on each page.
|
| 26 |
|
| 27 |
* On taxonomy pages, the term description is used as the DESCRIPTION
|
| 28 |
tag. The term itself is added to the list of KEYWORDS. You can override
|
| 29 |
the description to use if you wish.
|
| 30 |
|
| 31 |
* You can seperately specify the meta tags to show on some specific pages of
|
| 32 |
your site (in example, the front page, the error 403 page, the error 404
|
| 33 |
page, the tracker page), or to use in specific situations (in example, when
|
| 34 |
the site is offline).
|
| 35 |
|
| 36 |
* The support for Views, and Panels has been removed from Nodewords
|
| 37 |
6.x-1.x on August 15, 2009; successive versions for Drupal 6 replaced it with
|
| 38 |
a more generic support for third-party module pages.
|
| 39 |
|
| 40 |
* You can select which of these tags you want to output on each page. You
|
| 41 |
can also remove the edit box for these tags from the node edit page if
|
| 42 |
you don't like using it.
|
| 43 |
|
| 44 |
* All text of the DESCRIPTION and KEYWORDS meta tags are added to the search
|
| 45 |
system so they are searable too; other meta tags could be added to the search
|
| 46 |
system too (depending on the code implemented from the module).
|
| 47 |
|
| 48 |
Installing Nodewords (aka Meta tags) (first time installation)
|
| 49 |
------------------------------------------------------------------------------
|
| 50 |
1. Backup your database.
|
| 51 |
|
| 52 |
2. Copy the complete 'nodewords/' directory into the 'modules/' directory of
|
| 53 |
your Drupal site.
|
| 54 |
|
| 55 |
3. Enable the "Nodewords" module from the module administration page
|
| 56 |
(Administer >> Site configuration >> Modules).
|
| 57 |
|
| 58 |
4. Configure the module (see "Configuration" below).
|
| 59 |
|
| 60 |
Configuration
|
| 61 |
------------------------------------------------------------------------------
|
| 62 |
1. On the access control administration page ("Administer >> User management
|
| 63 |
>> Access control") you need to assign:
|
| 64 |
|
| 65 |
+ the "administer nodewords" permission to the roles that are allowed to
|
| 66 |
administer the meta tags (such as setting the default values and/or
|
| 67 |
enabling the possibility to edit them),
|
| 68 |
|
| 69 |
+ the "edit XYZ tag" permission to the roles that are allowed to set and
|
| 70 |
edit meta tags for the content (there is a permission for each of the
|
| 71 |
meta tags currently defined).
|
| 72 |
|
| 73 |
All users will be able to see the assigned meta tags.
|
| 74 |
|
| 75 |
2. On the settings page ("Administer >> Content management >>
|
| 76 |
Nodewords") you can specify the default settings for the module.
|
| 77 |
Users need the "administer nodewords" permission to do this.
|
| 78 |
|
| 79 |
3. The front page is an important page for each website. Therefor you can
|
| 80 |
specifically set the meta tags to use on the front page meta tags
|
| 81 |
settings page ("Administer >> Content management >> Nodewords >>
|
| 82 |
Front page").
|
| 83 |
Users need the "administer nodewords" permission to do this.
|
| 84 |
|
| 85 |
Alternatively, you can opt not to set the meta tags for the front page
|
| 86 |
on this page, but to use the meta tags of the view, panel or node the
|
| 87 |
front page points to. To do this, you need to uncheck the "Use front
|
| 88 |
page meta tags" option on the settings page.
|
| 89 |
|
| 90 |
Note that, in contrast to previous versions of this module, the site
|
| 91 |
mission and/or site slogan are no longer used as DESCRIPTION or ABSTRACT
|
| 92 |
on the front page!
|
| 93 |
|
| 94 |
4. You can completely disable the possibility to edit meta tags for each
|
| 95 |
individual content type by editing the content type workflow options
|
| 96 |
("Administer >> Content management >> Content types").
|
| 97 |
|
| 98 |
Note that this will still output the default values for the meta tags.
|
| 99 |
|
| 100 |
How to define meta tags in third-party modules
|
| 101 |
------------------------------------------------------------------------------
|
| 102 |
Modules that need to intregrate with Nodewords to define new meta tags need to
|
| 103 |
define two hooks: hook_nodewords_tags_info(), and hook_nodewords_api().
|
| 104 |
|
| 105 |
function hook_nodewords_tags_info() {
|
| 106 |
$tags = array(
|
| 107 |
'dc.title' => array(
|
| 108 |
'tag:context:denied' => array(NODEWORDS_MT_TYPE_DEFAULT),
|
| 109 |
'tag:db:type' => 'string',
|
| 110 |
'tag:function:prefix' => 'test_metatags_dc_title',
|
| 111 |
'tag:template' => array('dc.title' => NODEWORDS_META),
|
| 112 |
'widget:label' => t('Dublin Core title'),
|
| 113 |
'widget:permission' => 'edit meta tag Dublin Core TITLE',
|
| 114 |
),
|
| 115 |
'location' => array(
|
| 116 |
'tag:context:allowed' => array(NODEWORDS_MT_TYPE_NODE, NODEWORDS_MT_TYPE_USER),
|
| 117 |
'tag:db:type' => 'array',
|
| 118 |
'tag:function:prefix' => 'test_metatags_location',
|
| 119 |
'tag:template' => array(
|
| 120 |
'geo.position' => NODEWORDS_META,
|
| 121 |
'icbm' => NODEWORDS_META,
|
| 122 |
),
|
| 123 |
'widget:label' => t('Location'),
|
| 124 |
'widget:permission' => 'edit location meta tag',
|
| 125 |
),
|
| 126 |
);
|
| 127 |
|
| 128 |
return $tags;
|
| 129 |
}
|
| 130 |
|
| 131 |
The returned array should contain the following values:
|
| 132 |
|
| 133 |
* tag:context:allowed, tag:context:denied - this indexes define in which
|
| 134 |
contexts the meta tags are allowed (and denied).
|
| 135 |
|
| 136 |
* tag:db:type - if the value of this index is not equal to string, the value
|
| 137 |
of the meta tag is passed to serialize before to be saved in the database
|
| 138 |
table used by Nodewords.
|
| 139 |
|
| 140 |
* tag:function:prefix - the prefix used when Nodewords looks for some
|
| 141 |
functions it uses; the actual implementation uses the following functions
|
| 142 |
(<suffix> stays for the value of this array index):
|
| 143 |
|
| 144 |
* <suffix>_form(&$form, $content, $options) - the function is used to
|
| 145 |
populate the form used to edit the meta tags.
|
| 146 |
|
| 147 |
* <suffix>_prepare(&$tags, $content, $options) - the function is used to
|
| 148 |
populate the array of meta tags before they are output in the page
|
| 149 |
template.
|
| 150 |
|
| 151 |
* <suffix>_settings_form(&$form, $form_id, $options) - the function is
|
| 152 |
used to populate a settings form; actually, the function is used to
|
| 153 |
populate the Nodewords settings page ($form_id == 'settings_form'),
|
| 154 |
or the content type settings page ($form_id == 'node_type_form').
|
| 155 |
|
| 156 |
* tag:function:parameters - an array passed to the functions used by
|
| 157 |
Nodewords as $options['parameters'] ($options is the last parameter
|
| 158 |
passed to the functions.
|
| 159 |
|
| 160 |
* tag:template - the string used as template when the meta tag is added to
|
| 161 |
the HTML tag HEAD; the value can be a constant as defined by the module, or
|
| 162 |
a string.
|
| 163 |
|
| 164 |
* tag:weight - the weight used to order the meta tags before to output them
|
| 165 |
in HTML; the lighter meta tag will be output first.
|
| 166 |
|
| 167 |
* widget:label - the label used as title in the fieldset for the form field
|
| 168 |
shown in the form to edit the meta tags values.
|
| 169 |
|
| 170 |
* widget:permission - the permission associated with the form fields used to
|
| 171 |
edit the meta tags values; this permission is used only when the meta tag
|
| 172 |
edit form fields are shown in a form that is accessible not only from the
|
| 173 |
administrators users (in example, in the node edit form, or in the user
|
| 174 |
profile form).
|
| 175 |
|
| 176 |
function hook_nodewords_api() {
|
| 177 |
return array('version' => 1.1);
|
| 178 |
}
|
| 179 |
|
| 180 |
The function returns an array that contains the following indexes:
|
| 181 |
|
| 182 |
* version - the API version used by the module; basing on this value
|
| 183 |
Nodewords will take the necessary steps to assure to keep the module
|
| 184 |
compatible with Nodewords (Nodewords actually uses the meta tags
|
| 185 |
implemented by a module that supports version 1.1 of Nodewords API).
|
| 186 |
|
| 187 |
To better understand how to write the code for custom meta tags, see
|
| 188 |
basic_metatags.module, extra_metatags.module, and
|
| 189 |
site_verification.module.
|
| 190 |
|
| 191 |
Using Nodewords and Tagadelic
|
| 192 |
------------------------------------------------------------------------------
|
| 193 |
The Tagadelic module (http://drupal.org/project/tagadelic) allows one to
|
| 194 |
create a cloud of all terms used. The keywords you assign to nodes with
|
| 195 |
the Nodewords module will not appear in these clouds.
|
| 196 |
|
| 197 |
If you want to use tagclouds and have the same terms in the KEYWORDS meta
|
| 198 |
tag, you can configure nodewords as follows:
|
| 199 |
|
| 200 |
1. Create a "Free tagging" vocabulary at "Administer >> Content management
|
| 201 |
>> Categories". For example, call this vocabulary "Keywords".
|
| 202 |
|
| 203 |
2. On the meta tags settings page ("Administer >> Content management >>
|
| 204 |
Nodewords"), select the "Keywords" vocabulary as one of the "Auto-keywords
|
| 205 |
vocabularies". This will make sure that all terms you assign to nodes
|
| 206 |
will appear in the KEYWORDS meta tag.
|
| 207 |
|
| 208 |
3. On the same page, deselect the checkbox "Keywords" in the "Tags to
|
| 209 |
show on edit form" fieldset. This will remove the meta tag KEYWORDS
|
| 210 |
input box on all node edit forms. The only way to assign KEYWORDS then
|
| 211 |
is to enter them in the vocabulary "Keywords" input box (which will
|
| 212 |
appear in the "Categories" box instead of the "Meta tags" one).
|
| 213 |
|
| 214 |
The result is that the meta tag KEYWORDS will only contain the keywords
|
| 215 |
assigned to nodes by entering them in the free-tagging input box of the
|
| 216 |
"Keywords" vocabulary. Nodewords will add them to the KEYWORDS meta tag
|
| 217 |
and you can use a tagcloud to show all keywords too.
|
| 218 |
|
| 219 |
Auto-generated meta DESCRIPTION for CCK content types
|
| 220 |
------------------------------------------------------------------------------
|
| 221 |
It is recommended to use the contemplate (Content Template) module to
|
| 222 |
create a nicer looking node teaser that can also be used as auto-generated
|
| 223 |
DESCRIPTION.
|
| 224 |
|
| 225 |
Bugs and shortcomings
|
| 226 |
------------------------------------------------------------------------------
|
| 227 |
* See the list of issues at http://drupal.org/project/issues/nodewords.
|
| 228 |
|
| 229 |
Credits / Contact
|
| 230 |
------------------------------------------------------------------------------
|
| 231 |
The original author of this module is Andras Barthazi. Mike Carter
|
| 232 |
(mike[at]buddasworld.co.uk) and Gabor Hojtsy (gobap[at]hp.net)
|
| 233 |
provided some feature enhancements.
|
| 234 |
Robrecht Jacques (robrecht.jacques[at]advalvas.be) is the current maintainer;
|
| 235 |
Alberto Paderno (k.iam[at]avpnet.org) is the current co-maintainer.
|
| 236 |
|
| 237 |
Best way to contact the authors is to submit a (support/feature/bug) issue at
|
| 238 |
the projects issue page at http://drupal.org/project/issues/nodewords.
|