Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jakarta-tapestry Wiki" 
for change notification.

The following page has been changed by AndreasBulling:
http://wiki.apache.org/jakarta-tapestry/CustomTagsInShell

The comment on the change is:
First version

New page:
If you (as in my case) want to put some HTML meta tags in your pages AFAIK the 
easiest solution is to provide a custom delegate to the
Shell component which writes the tags you want.

First you have to define a Shell component in the HTML template (most 
preferable in the one of a custom Border component):

{{{
<span jwcid="$content$">
<html jwcid="shell">
<body jwcid="@Body">
...
}}}

In the page specification (or component specification if you use a custom 
Border component) you have to add the following to bind the delegate bean to 
the Shell component:

{{{
<bean name="shellDelegate" class="ShellDelegate"/>

<component id="shell" type="Shell">
    <binding name="delegate" value="bean:shellDelegate"/>
</component>
}}}

An example ShellDelegate bean could look like:

{{{
public class ShellDelegate implements IRender
{
        public void render(IMarkupWriter writer, IRequestCycle cycle)
        {
                addTag(writer, "copyright", "YOUR_COPYRIGHT_NOTICE");
                addTag(writer, "author", "YOUR_NAME");
                addTag(writer, "robots", "Index,Follow");
                
                addTag(writer, "description", "DESCRIPTION");
                addTag(writer, "keywords", "KEYWORDS" );
        }

        private void addTag(IMarkupWriter writer, String key, String value)
        {
                writer.beginEmpty("meta");
                writer.attribute("name", key);
                writer.attribute("content", value);
                writer.print("\n");
        }
}
}}}

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to