LunpaCMS Whipping your website into shape! Introducing Lunpa, our mascot.  Her mother was a hamster and her father was Chilean M00se.  Oddly, neither smelt of elderberries.


LunpaCMS Auto Meta Documentation

A Quick Introduction

Websites, in the know with SEO, use metadata to craft summaries of their contents for Search Engines (Google, Bing, Yahoo, etc.) to harvest. Most websites do this Search Engine Optimization by hand (and LunpaCMS gives you that option), but LunpaCMS shines with its automatic metadata routines, coined Auto Meta.

Manual Metadata

Adding metadata is an easy process of updating two items under Map Manager. In Map Manager, find "LOCAL_META_KEYWORDS" and update its value with the list of comma-separated keywords you would like to have appearm and uncheck disabled box.. Similarly, find "LOCAL_META_DESCRIPTION" and update its value with the list of comma-separated descriptions you would like to have appear and uncheck disabled box. Tada, you are done. The list of items added in those two Maps will appear on every webpage you generate.

Why Auto Meta?

While the manual method of adding metadata is helpful for the globally-related website keywords & descriptions, it doesn't really help in properly outlining & summarizing specific pages. Obviously, the task of manually generating a unique set of keywords & descriptions for each page on your website would be entirely too cumbersome a project. Similarly, trying to condense the specifics of all those pages into a lengthy and globally-applicable homogenous paste for web-crawler consumption will certainly cramp your style. However, with the Auto Meta feature of LunpaCMS, you can relax. Simply go to Map Manager, find "ENABLE_AUTO_META", enter "1" in Map Value, uncheck the disable box, and save the setting.

What happens now?

Having enabled the "ENABLE_AUTO_META" map under Map Manager, you may wonder what happens next. Well, there is no more worry or work needed from you, because you have activated the automatic metadata-mining routines. Just load up a page and you will find auto-generated metadata for each page.

What's happening?

Under LunpaCMS, browsing to a specified webpage is calling a specified template. The Auto Meta routines call the template and scan it for useful keywords & descriptions. Technically speaking, what's happening after it reads the specified template is to cull out noise words, such as "a" and "the" and "these", to get to the significant data in the template. This mined data is then automatically added to the Meta Keyword & Meta Description tags. Thus, the automatically generated metadata is relevant to the specific page. Also, any metadata previously entered manually in Map Manager (i.e. under "LOCAL_META_KEYWORDS" and "LOCAL_META_DESCRIPTION") is appended to the automatically generated metadata for each page.

Disallowing Search Engine Indexing

To disallow search engines indexing specific scripts, add the parameter no_index to the call to print_html_head_and_body (or just print_body if your site is older). This will add a meta tag to the beginning of the page that tells search engines to skip just this page. This makes it simpler to exclude specific scripts that don't make sense to have indexed.

Ex. &Library_global::print_html_head_and_body($FORM, no_index=>1);

Auto Meta Main Template Parsing

Auto Meta parses main templates (main_begin.template and main_end.template) as well as page content template for index.cgim by default. Auto Meta doesn't parse main templates for all other pages. If Auto Meta doesn't need to parse main templates for index.cgim, remove main_begin and main_end parameters from auto_meta() sub routine call in index.cgim.

Using Auto Meta Data From Images

Auto Meta automatically collects significant data from Heading tags to use in meta descriptions, but what if you want to use a graphic generated outside of using the Heading tag? Using the Lunpacms Image tag (:::IMAGE:::) to display graphical images as headers or whenever you want the alternate text to be put into the meta descriptions tag, you can add the autometa=1 parameter to the Image tag in order to grab the text automatically. See http://www.lunpacms.org/base.cgim?template=example_images for more detailed implementation instructions.

Updating Old Auto Meta

If you have an older LunpaCMS installation, you can update to the newer autometa routine by doing some quick changes to your index.cgim and base.cgim.

In index.cgim:

  1. Remove all lines below &Library_global::print_html_header(); in main sub routine.
  2. Add following lines after &Library_global::print_html_header(); line.
      #AUTO META 2.0
      my ($template_content, $meta_keywords, $meta_description);
      unless ($params{'no_main_templates'}) {
        ($template_content, $meta_keywords, $meta_description) = &Library_global::auto_meta($FORM, template=>$FORM->{'template'}, main_begin=>$main_begin, template_dir=>$alt_template_dir, main_end=>$main_end, index=>1);
      } else {
        ($template_content, $meta_keywords, $meta_description) = &Library_global::auto_meta($FORM, template=>$FORM->{'template'}, template_dir=>$alt_template_dir, index=>1);
      }
    
      $pre_body_text = "";
    
      unless ($params{'no_main_templates'}) {
        &Library_global::print_html_head_and_body($FORM, title=>"", pre_body_text=>$pre_body_text);
      }
      #-------->Headers & Body END------------------#
    
    
      #-------->Main-Begin START -------------------#
      #This is the top piece of bread in our template sandwich.
      unless ($FORM->{'no_main_templates'}) {
        &Library_global::print_template($FORM, template=>$main_begin, template_dir=>$alt_template_dir);
      }
      ###------>Main-Begin END ---------------------#
    
    
      #----------------->Customize CGI Start--------#
      #This is where the normal "meat" of a page is produced.
      #
      #Anything that occurs outside of the customize CGI portion of the code should have clear 
      #and descriptive comments!
    
      #DEBUG INFO TO START
      #print &Library_global::debug_hash($FORM);
      #print &Library_global::debug_env;
      #END DEBUG INFO
    
      print $template_content;
    
      ###--------------->Customize CGI END----------# 
    
    
      #-------->Main-End START ---------------------#
      #This is the bottom piece of bread in our template sandwich.
      unless ($FORM->{'no_main_templates'}) {
        &Library_global::print_template($FORM, template=>$main_end, template_dir=>$alt_template_dir);
      }
      #-------->Main-End END -----------------------#
    
      &Library_global::disconnect($Library_phw::dbh);
          

In base.cgim:

  1. Remove all lines below &Library_global::print_html_header(); in main sub routine.
  2. Add following lines after &Library_global::print_html_header(); line.
      #AUTO META 2.0
      my ($template_content, $meta_keywords, $meta_description);
      ($template_content, $meta_keywords, $meta_description) = &Library_global::auto_meta($FORM, template=>$FORM->{'template'}, template_dir=>$alt_template_dir);
    
      $pre_body_text = "";
    
      &Library_global::print_html_head_and_body($FORM, title=>$params{'title'}, pre_body_text=>$pre_body_text);
      #-------->Headers & Body END------------------#
    
    
      #-------->Prior to Main-Begin START ---------------#
      #If you need to do something prior to Main-begin, do it here.
    
      ###------>Prior to Main-Begin END -----------------#
    
      #-------->Main-Begin START -------------------#
      #This is the top piece of bread in our template sandwich.
      unless ($FORM->{'no_main_templates'}) {
        &Library_global::print_template($FORM, template=>$main_begin, template_dir=>$alt_template_dir);
      }
      ###------>Main-Begin END ---------------------#
    
    
      #----------------->Customize CGI Start--------#
      #This is where the normal "meat" of a page is produced.
      #
      #Anything that occurs outside of the customize CGI portion of the code should have clear 
      #and descriptive comments!
    
      #DEBUG INFO TO START
      #print &Library_global::debug_hash($FORM);
      #print &Library_global::debug_env;
      #END DEBUG INFO
    
      print $template_content;
    
      ###--------------->Customize CGI END----------# 
    
    
      #-------->Main-End START ---------------------#
      #This is the bottom piece of bread in our template sandwich.
      unless ($FORM->{'no_main_templates'}) {
        &Library_global::print_template($FORM, template=>$main_end, template_dir=>$alt_template_dir);
      }
      #-------->Main-End END -----------------------#
    
      &Library_global::disconnect($Library_phw::dbh);
          

Add Your Comment


(Only a limited set of HTML tags such as <b>, <i>, <u> are allowed. Embedded flash video from Youtube or Vimeo are also supported.)


Copyright © 2024 Peregrine Computer Consultants Corp. All rights reserved.

About Lunpa, our mascot. Her mother was a hamster and her father was an ill-tempered Chilean M00se. Oddly, neither smelt of elderberries.
The artist is Jennifer Lomax.