Domino Code Fragment

Code Name*
Meta Tag Demo
Date*
12/31/2001
Source (or email address if you prefer)*
Anonymous
IP address:.62.128.209.138
Description*
Type*
Formula, JavaScript
Categories*
User Interface (Web), Website Tools
Implementation:
None (plug and play)
Required Client:
(none)
Server:
(none)
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
The META Tag demo
About
Brief Explaination of META limitations in Domino R4.x - 5.x


Domino and commercial search engines, such as Excite or Alta Vista, aren't exactly best buddies. Why? Because most standard Domino URL's include "?" command syntax (?OpenDocument, ?OpenView, ?OpenElement, etc.). Any time a search engine sees one of these commands, it "assumes" that it's a CGI program, and doesn't index it.

And even if it did, standard Lotus Domino web site applications do not include meta tags and that is why the above article was added. For those newer to internet programming and maybe prgramming Domino for the web, Meta Tags are descriptive text elements used in HTML that are used by some search engines, and contain information such as a site description, author, keywords, etc. Domino does not have provisions for Meta Tags unless developed into an application by the developer using coding techniques mentioned above. I have not tested RNext yet, but I hope to see this made easier in the future.

Have you ever had the problem of deciding what to do wth META tags in your Domino applications?. Well I have. Domino allows you to insert HTML into Domino documents for the web browser in several ways, however depending on the style and Domino methods ie templates design you employ it can be difficult to decide on the right approach to allow you to have centrally managed META tag documents that can be used for all pages. Well here is one way to solve that problem.

You could simply paste in META tags from another HTML editing program or existing HTML document, but often your Domino application design uses other content lookups or complex template headers, subforms and the little tricks we developers employ to format the Domino document, These features will not work with the Domino HTML conversion process ie the HTML META tags do not go between the <Head></Head> section on HTTP conversion, a typical Domino feature for want of a word. Instead , in an $$HTMLHead field or the HTML Head Content property in 5.x, build a simple @DbLookup to a document containing the text of your META tags. This approach allows you to easily maintain all of your meta tags in one central location, eliminates the annoyance of having to format all of your embedded quotes with "\" in formulas if using field formulae to generate META Tag information, and makes reuse of the META tags very easy across your Domino intranet or Internet applications. You can easily expand on this concept to maintain MET
A tags for specific pages and/or forms via formula/lookup and filter criterion, as we have done in the design templates of http://www.calaman.com.

1. Create a simple lookup database and create a "Keyword" form with two editable text fields, Keyword (META Tag Name) and Content (META Tag Value). Build a two column view (Sorted) which displays all META Tag keyword names (document) sorted by META Keyword name in the first column, and Content data in the second column.

2. Create a "Keyword" document. In the Keyword field specify "METATAGS". In the Content field put the HTML META tags. For example, <META name="keywords" content="Domino,Lotus,Notes">

3. Add a @DbLookup formula to the $$HTMLHead field(designed for R4), or the R5 HTML Head Content property of your page or form:
METATag := @DbLookup("":"Nocache";"";"Library";"METATAGS";2);
@If(@IsError(METATag);"";METATags)

3a. Another method is to configure your lookups to be smarter ie lookup individual META Tag types as needed for each particular form. What we have done for this site is that we have used a library database in which we have forms to enter META Tag Keywords ie one document per META Tag. We then use a shared field 'METATags' in our topic document forms. The METATag field has several fomulae that use @DBlookup to lookup the appropriate MTEA Tag keywords to pull into the document the wanted META Tags. This allows us develop an application that can have different forms with different META Tags. ie one form can have <meta NAME="ROBOTS" CONTENT="ALL"> set as a keyword lookup and another form can have <meta NAME="ROBOTS" CONTENT="ALL">. This way one form will index and the other will not. You can use view source in your browser options to see this pages META tags. The META tags are looked up on document creation and saved into the document. A consideration you might want to make is to make the META Tags field lookup t
o be computed for display ie refreshed each time the form is loaded. If you do this then it helps when the database of keywords is changed, your META Tags change aswell. Performance might be an issue. You can decide between computed for display or computed fields. Make sure you think about the consequences of your choice!

When your web page is rendered by Domino and sent to the browser, your META tags are automatically included. NOTE that Domino R5 tries to suggest that you alwasy use the HTML Head content property of Domino R5, but that does not always suit your application design. There is still a lot to be said about the R4 web design mentality and I believe using fomulae in subforms and shared fields is still a very important point to consider in your application designs.

Good luck with your developments and let's hope those search egines find your pages!

PS. A useful META dictionary can be found here http://vancouver-webpages.com/META/

Available after registration from downloads section.

http://www.calaman.com
http://www.calaman.com/download.nsf/788925f20e7931c7852563e6006a0707/9f428e9bdced8d3a80256b2c0022728e?OpenDocument