Free Trial

Markup Factory Documentation

Open up a can of Markup Factory on your website.

Addressing Schema

An addressing schema is the method you use to make addresses for the content on your website. Having a good addressing schema is important for keeping your website content organized and for increasing search engine visibility for your website. You should make similar URLs for pages with similar content and use the keywords related to this content in the URLs of your pages.

Example

Your company has two products, and about page, and a contact page. Your products are called "Widget A" and "Widget B". You should create pages with the following URLs:

  • http://www.yourdomain.com/
  • http://www.yourdomain.com/about
  • http://www.yourdomain.com/products/widget-a
  • http://www.yourdomain.com/products/widget-b
  • http://www.yourdomain.com/contact

Leveraging the MF Addressing Schema

The Markup Factory Template Engine provides the capabilities for dynamically assembling your templates based on the URLs of your website content and other system variables. In the example above, three "paths" were specified (about, products, and contact), and two "tags" were also specified (widget-a and widget-b).

These variables are implicitly taken from the URL of a page in the form:

http://www.yourdomain.com/{path}/{tag}

You may use these variables in MFScript as "@path" and "@tag".

Applying this method, you may elect to have a portion of your main navigation highlighted when a visitor is on that section of the website. In this instance, it would be good practice to highlight the "Products" link when the visitor is viewing one of the two products pages. To do this, consider the following.

The following code represents the main navigation for this website:

<ul id="main-navigation">
    <li><a href="/">Home</a></li>
    <li><a href="/about">About</a></li>
    <li><a href="/products">Products</a></li>
    <li><a href="/contact">Contact</a></li>
</ul>

To enable highlighting of the links when a visitor is on the appropriate portion of the website, insert MFScript as follows:

<ul id="main-navigation">
    <li{{MFSCRIPT if @path = "" then output " class=""highlighted"""}}><a href="/">Home</a></li>
    <li{{MFSCRIPT if @path = "about" then output " class=""highlighted"""}}><a href="/about">About</a></li>
    <li{{MFSCRIPT if @path = "products" then output " class=""highlighted"""}}><a href="/products">Products</a></li>
    <li{{MFSCRIPT if @path = "contact" then output " class=""highlighted"""}}><a href="/contact">Contact</a></li>
</ul>

Now, when a visitor views one of the "product" pages, the main navigation will show in the browser as follows:

<ul id="main-navigation">
    <li><a href="/">Home</a></li>
    <li><a href="/about">About</a></li>
    <li class="highlighted"><a href="/products">Products</a></li>
    <li><a href="/contact">Contact</a></li>
</ul>

Refer to CSS resources to set up proper styling for your navigation and also visit the MFScript documentation to learn more about leveraging the power of MFScript in your website templates and pages.

Creating a Site Map and a Robots File

It is good practice to create a site map for your website following standards described on the sitemap.org website. To create a valid sitemap, we currently recommend this method:

  1. Create a new Templated called "Sitemap"
  2. Create a new page with no content and set the URL to http://www.yourdomain.com/sitemap.xml. Set this page to use the "Sitemap" template
  3. Once you've created this page, edit the "Sitemap" Template to include the valid XML for your sitemap

Note: You can use this same method to create a Robots.txt file.  For details and benefits on how to construct your robots.txt file, visit robotstxt.org.

Copyright © 2024 Cramer Development also offering Web Design in Iowa City. All rights reserved.Terms of ServicePrivacy PolicyFAQContact Us