Edit
Attach
Printable
topic end
---+!! <nop>%TOPIC% <!-- Contributions to this TWiki plugin are appreciated. Please update the plugin page at http://twiki.org/cgi-bin/view/Plugins/HtmlMetaPlugin or provide feedback at http://twiki.org/cgi-bin/view/Plugins/HtmlMetaPluginDev. If you are a TWiki contributor please update the plugin in the SVN repository. --> <sticky><div style="float:right; background-color:#EBEEF0; margin:0 0 20px 20px; padding: 0 10px 0 10px;"> %TOC{title="Page contents"}% </div></sticky> %SHORTDESCRIPTION% ---++ Introduction This plugin exists for one reason, and one reason only: To get <meta> tags into the html header. Why? It turns out that some search engines won't index a page without "proper" meta tags. Other search engines give better results with meta tags. Unfortunately, TWiki didn't have a good way to do this. %<nop>HTTP_EQUIV_ON_VIEW% isn't really up to the task, as it only allows you to specify one thing. ---++ Syntax Rules * %<nop>HTMLMETA{[name=]"meta name" content="meta content" [visibility="number"]}% * This variable follows the standard TWiki syntax: The first parameter's name is optional. * If "meta name" is not unique, the last one specified wins! * visibility is optional. If not given, the VISIBILITY configuration variable will be used; otherwise, the value of this parameter will be added to the value of the VISIBILITY configration variable. If the resulting value is > 0, then the %<NOP>HTMLMETA% variable will be displayed in the topic's body. Otherwise, and by default, it will not be. ---++ Examples * %<nop>HTMLMETA{name="keywords" content="TWiki,plugins,metatags"}% Set meta keywords for this page. * %<nop>HTMLMETA{"description" content="This page describes the <nop>HtmlMeta plugin"}% Set meta description for this page. Name is defaulted. * %<nop>HTMLMETA{name="copyright" content="&<nop>copy;2006" visibility="1"}% Set copyright for this page. The variable will also display on the page. ---++ Plugin Settings Plugin settings are stored as preferences variables. To reference a plugin setting write ==%<nop><plugin>_<setting>%==, i.e. ==%<nop>NEWPLUGIN_SHORTDESCRIPTION%== * One line description, is shown in the %SYSTEMWEB%.TextFormattingRules topic: * Set SHORTDESCRIPTION = Insert HTML "meta name" entries into html header * To get debug messages (in data/debug.txt), set DEBUG to 1. Default: 0 * Set DEBUG = 1 * Master control on visibility in topic of HTMLMETA variable (integer: Added to VISIBILITY in HTMLMETA, if present. If total > 0, show variable, otherwise, don't): * Set VISIBILITY = 0 ---++ Plugin Installation Instructions __Note:__ You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the TWiki server. * Download the ZIP file from the plugin web (see below) * Unzip ==%TOPIC%.zip== in your twiki installation directory. Content: | *File:* | *Description:* | | ==data/TWiki/%TOPIC%.txt== | Plugin topic | | ==lib/TWiki/Plugins/%TOPIC%.pm== | Plugin Perl module | * Configure the Plugin: * Run the [[%SCRIPTURL{configure}%][configure]] script to enable the plugin * Change the plugin settings as needed * Test if the installation was successful: * Since this plugin creates HTML Metadata in the <head> section, you have to view source to tell if it worked. If so, it will look something like: <verbatim> <!--HTMLMETAkeywords--> <meta name="keywords" content="TWiki wabbit" /> </verbatim> * This will be quite a ways down in the source! * Here are a bunch of examples, some good, some not. Note that by default, many of them do not show up in the topic when the plugin is enabled, so I've listed each one twice: Once simulated, once real. If the simulated one would not show up by default, it is in _italics_ * This one is good, but invisible by default: %BR% _%<nop>HTMLMETA{name="keywords" content="TWiki"}%_ %BR% %HTMLMETA{name="keywords" content="TWiki"}% * This one is, too %BR% _%<nop>HTMLMETA{name="description" content="It's all about TWiki"}%_ %BR% %HTMLMETA{name="description" content="It's all about TWiki"}% * This one has no content: %BR% %<nop>HTMLMETA{name="nocontent"}% - ERROR (!HtmlMetaPlugin::_HTMLMETATAG): meta content not defined. %BR% %HTMLMETA{name="nocontent"}% * I've been through the desert on an HTMLMETA with no name: %BR% %<nop>HTMLMETA{content="no name"}% - ERROR (!HtmlMetaPlugin::_HTMLMETATAG): meta name not defined. %BR% %HTMLMETA{content="no name"}% * This one is ok, uses default for name, but invisible by default: %BR% _%<nop>HTMLMETA{"default" content="default name"}%_ %BR% %HTMLMETA{"default" content="default name"}% * This one has a bad name: %BR% %<nop>HTMLMETA{name="1Evil1" content="Doesn't start with a letter"}% - ERROR (!HtmlMetaPlugin::_HTMLMETATAG): meta name has invalid characters. %BR% %HTMLMETA{name="1Evil1" content="Doesn't start with a letter"}% * A good name is to be desired, this one doesn't have one: %BR% %<nop>HTMLMETA{name="<html here>" content="Has html in it"}% - ERROR (!HtmlMetaPlugin::_HTMLMETATAG): meta name has invalid characters. %BR% %HTMLMETA{name="<html here>" content="Has html in it"}% * This one has html in the content, should be escaped, but invisible by default: %BR% _%<nop>HTMLMETA{name="ok1" content="<evil html>"}%_ %BR% %HTMLMETA{name="ok1" content="<evil html>"}% * This one has a non-character entity:%BR% %<nop>HTMLMETA{name="bad3" content="	"}% - ERROR (!HtmlMetaPlugin::_HTMLMETATAG): meta content cannot contain non-character entities. %BR% %HTMLMETA{name="bad3" content="	"}% * This one has a hex non-character entity: %BR% %<nop>HTMLMETA{name="bad4" content="
"}% - ERROR (!HtmlMetaPlugin::_HTMLMETATAG): meta content cannot contain non-character entities. %BR% %HTMLMETA{name="bad4" content="
"}% * This one has an extended character, which is ok, but invisible by default: %BR% _%<nop>HTMLMETA{name="ok2" content="seņora"}%_ %BR% %HTMLMETA{name="ok2" content="seņora"}% * This one has a (character) entity, which is ok, but invisible by default: %BR% _%<nop>HTMLMETA{name="ok3" content="©2006"}%_ %BR% %HTMLMETA{name="ok3" content="©2006"}% * This one has a ^G, which is not ok: %BR% %<nop>HTMLMETA{name="bad5" content=""}% - ERROR (!HtmlMetaPlugin::_HTMLMETATAG): meta content cannot contain non-characters. %BR% %HTMLMETA{name="bad5" content=""}% * This one has bad visibility, so you can't see it in the header: %BR% %<nop>HTMLMETA{name="bad6" content="bad visibility" visibility="yes"}% - ERROR (!HtmlMetaPlugin::_HTMLMETATAG): visibility must be a number. %BR% %HTMLMETA{name="bad6" content="bad visibility" visibility="yes"}% * This one has positive visibility, so you should see it: %BR% %<nop>HTMLMETA{name="ok4" content="positive visibility" visibility="1"}% %BR% %HTMLMETA{name="ok4" content="positive visibility" visibility="1"}% * If I was invisible...This one has negative visibility, so you shouldn't see it: %BR% _%<nop>HTMLMETA{name="ok5" content="negative visibility" visibility="-1"}%_ %BR% %HTMLMETA{name="ok5" content="negative visibility" visibility="-1"}% * This one is good, but invisible by default. It is also has a duplicate name, so it is used, not the first one: %BR% _%<nop>HTMLMETA{name="keywords" content="TWiki wabbit"}%_ %BR% %HTMLMETA{name="keywords" content="TWiki wabbit"}% ---++ Plugin Info | Plugin Author: | TWiki:Main.DougClaar | | Copyright: | © 2006, TWiki:Main.DougClaar <br /> © 2006-2010 TWiki:TWiki/TWikiContributor | | License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) | | Plugin Version: | 2010-11-09 (V1.1) | | Change History: | <!-- versions below in reverse order --> | | 2010-11-09: | Doc improvements | | 2006-05-09: | Initial version | | TWiki Dependency: | $TWiki::Plugins::VERSION 1.1 | | CPAN Dependencies: | none | | Other Dependencies: | none | | Perl Version: | 5.005 | | [[TWiki:Plugins/Benchmark][Benchmarks]]: | %SYSTEMWEB%.GoodStyle 100%, %SYSTEMWEB%.FormattedSearch 100%, %TOPIC% 100% | | Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC% | | Feedback: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Dev | | Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Appraisal | __Related Topics:__ %SYSTEMWEB%.TWikiPlugins, %SYSTEMWEB%.DeveloperDocumentationCategory, %SYSTEMWEB%.AdminDocumentationCategory, %SYSTEMWEB%.TWikiPreferences
to top
End of topic
Skip to action links
|
Back to top
Edit
|
Attach image or document
|
Printable version
|
Raw text
|
Refresh
|
More topic actions
Revisions: | r1.1
|
Total page history
|
Backlinks
You are here:
TWiki
>
HtmlMetaPlugin
r1.1 - 25 May 2016 - 12:53 -
ClausBrod
to top
TWiki
Welcome
Register
?
TWiki Web
TWiki Web Home
Changes
Topics
Index
Search
TWiki Webs
Atari
Blog
Claus
CoCreateModeling
Klassentreffen
Main
Sandbox
Sommelier
TWiki
Xplm
My links
edit
TWiki
Welcome
TWiki Web TWiki Web Home Changes Topics Index Search
TWiki Webs Atari Blog Main
OneSpaceModeling
?
Sandbox TWiki TWiki Webs Atari Blog Main
OneSpaceModeling
?
Sandbox TWiki
Jump:
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback