logo

New Response

« Return to the blog entry

You are replying to:

    • avatar
    • Tue Skaarup
    • Posted on Tue 22 Jun 2010 01:54 PM

    I was in the same situation as you. Tried to find documentation and examples elsewhere to tell me how it could be done.

    I didn't find any, so I had to try myself. It took MANY http restarts to find a solution :-) Here is what I came up with:

    The substitution patterns in use on e-conomic's websites are tailored to make clean URLs for these URL structures:

    Section pages: domain.tld/section/

    Category pages: domain.tld/section/category/

    Subpages (1): domain.tld/section/page

    Subpages (2): domain.tld/section/category/page

    Notice how section pages and category pages ends with a '/' while subpages do not. This is how I want it because of usability, but it is possible to have all pages end with or without a '/'.

    Substitution patterns to make this work:

    Section level substitutions:

    /[section name]/* -> /[db path]/[db name]/[view name]/w-[page URL name]-*

    Category level substitutions:

    /[section name]/*/* -> /[db path]/[db name]/[view name]/w-[page URL name]-*-*

    View for looking up webpages:

    The view with the name [view name] got values in first column made of section name, category name and page URLs like this:

    Section pages: w-[section name]-

    Category pages: w-[section name]-[category name]-

    Subpages (1): w-[section name]-[page URL name]

    Subpages (2): w-[section name]-[category name]-[page URL name]

    Notice how the trailing '-' is used to determine if the page is a section/category page or a subpage.

    With this substitution pattern, only the section names needs to be put into substitution documents as absolute values. No big deal as most websites should only have a few sections anyway.

    The category names works dynamically and can be chosen/edited in the CMS.

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment: