Search Engine Optimization

Search Engine Optimization (SEO) is an important aspect of website development. Website are ranked according to various properties such as internet popularity, the use of properly semantic html, sensible url's, keyword and the actual texts on the site. This is a big subject and there are many other resources on the internet and consultants to be hired, in order to help your rise to the top of the search engine results. However there are a few easy tricks to help you with common optimization demands.

Document title and meta tags

A document title is important since it says something about the content of the page and it is also displayed by search engines in their result pages. If this title is always the same, the search engine is bored and you may get a lower ranking, plus it doesn't look good in the results.

Document titles

A document title is automatically created by the application engine based on the application name, class name and name fields of the class depending on what kind of page is shown. For example a detail page of the "Prunus padus" object of the class "Flowers" in the application "Garden" would have the automatic title "Garden - Flowers: Prunus padus". You can also set a document title yourself by passing it to the document object which is available in every velocity template like so:

$document.setTitle("Garden flowers - Bird cherry-tree")

The surrounding page will then write this title using $document.getTitle(). If you are using your own surrounding page be sure to include this code in the html header.

Meta tags

Although apparently less important for search engine ranking then before, it is still a good idea to add keywords and descriptions to each page. This is not done automatically. You must do this yourself by passing them to the document object like so:

$document.setKeywords("flower garden latin summer plants winter seasons spring autumn")
$document.setDescription("Prunus padus, known as Bird Cherry or Hackberry, is a species of cherry, native to northern Europe and northern Asia. It is a deciduous small tree or large shrub, 8–16 m tall, which grows north of the Arctic Circle in Norway, Sweden, Finland and Russia. It is the type species of the subgenus Padus, which have flowers in racemes.")

Again the surrounding page will write these meta tages when it encounters $document.getMetaTags(). It is also possible to add any other meta tag by using the generic addMetaTag(String, String) method.

Readable url's 

At the start of the internet most of the web content where static html pages so alexander-the-great.html would actually return a html page on Alexander the Great. However with the advance of database driven websites, most html pages nowadays are created dynamically. This tends to result in less than readable url's for example /bios/template.php?id=2934. Therefore more human readable url's were needed, ones that could be controlled by an CMS editor. Thus the content management url was born also called SEO url or url shortcut or alias. They are not only pleasing to the human eye, they also improve you search engine score, because the search engine can actually index the words used and make sense of them as well!

Permalinks

A common action is to view the details of an object in the database, for example a person. The standard url would look something like this:

  • /engine?service=classmanager:3492&cmd=open&id=88

However, the system automatically generates a permalink for you using the label fields of the object to be retrieved, for example:

  • /person/88/alexander-the-great

This request does exactly the same as the first one. However, the shorter form and the added text makes it better readable for the search engines. Note that the "alexander-the-great" part has no function other than providing a readable description, the application engine does not use it to recover the appropriate object details. In fact /person/3492/88/ would work just as well and even /person/88/cleopatra will also recover the details of Alexander the Great! This doesn't sound so great because you really want only a single url to refer to the same content. Fortunately the system will automatically reply with a 'permanently moved to' response containing the current valid permalink.

So using permalinks are a great way too optimize search results. To make use of them

But in some cases you may want even more control over the exact form of the url...

Custom url's

A custom url is a user-defined "alias" for a request. This gives you complete control over the entire url (excluding the domain part). This way you can make url's like:

  • /biographies/alexander-the-great
  • /contact
  • /documentation/faq/search-engine-optimization

The application engine maps the url's above to the 'real' url. These custom url's look even better and are often used in print because they are more easily memorized. They do take a bit more work then the automatically created human readable url's (see implementation below). Note also that custom url's are case-insensitive so "/contact" is treated the same as "/Contact".

Human readables vs. custom urls

Human readable url's need the least amount of work. They will also still work if the text part of the url is changed meaning they degrade gracefully in search engine results. They do need some numbers in them in order for the application engine to make sense of them. In our experience, this does not significantly affect ranking, human readable url's seem to be indexed just as well as custom url's. Human readable url's are limited to retrieving object detail pages (for now).

Custom url's require a little bit more work, but they give complete control over your url's and you can map it to all kinds of requests, not just object detail pages. If you have a lot of objects it may be too much work to give every object an adequate nice-looking url. In this case, human-readable url's is probably the wiser option. Also, you will need to take care of redirects yourself, if the url changes (see: How to use the custom urls)

Velocity templates

By default all detail pages are retreived using human readable urls. The readable part of the url corresponds to the object's label as specified in the blueprint. If you are using your own velocity page to display the detail page, for example on a public website of your application, you should implement this page as an an object template in the blueprint. You can then use the human readable urls or the custom url's as requests to show the detail pages. 

Assuming you have already made a template called "page.vm" (for example), instead of calling it directly with a parameter, set it as a HTML template in the blueprint to be used instead of the regulare engine object detail screen. This may be entered at the class presentation tab. However, this means the template will be used for every user. If you want to finetune this, you can add the template at in a class relevance row for the appropriate user. You will need to alter the template slightly because there is no need anymore to get the object detail record since it will automatically be present in the velocity context. Now, If you are using human readable or custom url's, these url will be automatically be returned by the the Menu.getUrl() and Record.getUrl() method.