An Extraordinary Website Utility

Markup Factory provides a full suite of integrated web based components allowing you to quickly develop a powerful and effective website.

From the Factory Floor

Tutorial: Adding URL-Specific Content to your Template using Datasets and Dynamic Snippets

November 7, 2008 - 10:06 AM

This tutorial will walk you through the steps to display content in your templates based upon the requested URL.

Step 1: Building a Custom Dataset for your Content

First, we are going to build a custom dataset to hold the content for our template.

To create your dataset, open your Markup Factory Admin Dashboard, and click on the Database Module. Once in the Database module, click "Add Dataset" to create your custom dataset.

We'll need to give our dataset a descriptive name, so name it something like "Dynamic Template Content", and click "Create Dataset."

Now our dataset is created!

Our dataset has been created!

As you can see, it doesn't have any fields yet.  Our next step is to add some fields to our dataset.  We want the content in our template to change based upon what the current URL is, so our dataset will have the two following fields:

  • Content (Text):  This will contain the content to display for each URL.
  • URL (Text): This is the URL that is associated with the content to display.

To begin adding fields, click the "add a field" link.  We'll go ahead and add the "URL" field first.  For the field name, enter "URL".  We will want this field to be a text field, so for the field type, choose text.  There are several other field types available, but for this tutorial, we will only be using the text field type.  The Include in List View option allows us to choose whether to display this field when view the records in the dataset list view.  For the "URL" field, we will want to enable this option.  Finally, we can choose an input type for this our field.  There are two options for the "Text" field type: Text Box, and Text Area.  Let's choose "Text Box" for this field.

Adding the URL field

Click "Save Settings" to add the "URL" field. 

There, our "URL" field has been added.  We still need to add our "Content" field though.  Go ahead and add the "Content" field, naming it "Content."  Select "Text" as the field type.  We don't want the content field to appear in the list view, so leave the list view box unchecked.  Finally, instead of a text box, choose "Text Area" as the input type, and save the field.

The dataset has now been built!  For now, we just have an empty dataset.  Eventually, we will add a record for each URL that we want to display custom content on.  For now, however, we'll only add one record to test our example.

To add a record to the dataset, click the "Dataset Records" tab.  You should see that there aren't any records currently in the dataset.  Click "Add a record" to get started.  For this example, lets add a record for a page with the url "/hello-world".   Enter /hello-world in the URL field, and in the content field, enter the text Hello World!.  Click "Save" to add the record.

There we go!  We've created a custom dataset, and have a record in it.  You can add some more records if you like.  Let's move on to step 2.

Step 2: Creating a Dynamic Snippet to Display Data from our Dataset

In this step, we'll create a dynamic snippet to display the data we just entered in our custom dataset.  Dynamic snippets allow you to link a snippet to a dataset, and wrap the data in the dataset with whatever HTML your would like.

Let's get started creating a new dynamic snippet.  Go back to your Markup Factory dashboard, and click on the "Templates" module.   To add a new snippet, click "Snippets", and then click "Create Snippets" near the bottom of the page.

Now, we'll setup our dynamic snippet. First we'll need to choose a name.  Let's name this snippet dynamic-content.  Next, we can choose a "Linked Dataset" for our snippet.  Linked datasets are a handy  tool to display dynamic data in our snippets.  We want to link to the dataset we created in step 1, so choose Custom: Dynamic Template Content from the drop down.

Next, we need to setup what data to display from our dataset.  There are several options available.  For this example, we only want to display the record for the URL of the current page.   To do so, we will add a filter based on the runtime variable, @url.  Under "Filters", click "Add Filter" to setup the filter.   We need to only display records where the URL field matches the @url runtime variable.  Select URL from the first drop down. The second drop down should be set to equals.  Finally, enter @url in the text box, and click Add Filter.

Note: The @url field does not contain trailing forward slashes.  For example, /hello-world/ is treated as /hello-world by the @url runtime variable. 

Add a filter

This filter will now only display records in the snippet when the current URL matches the URL field in our custom dataset.

Now, we just need to tell our snippet how to display the dynamic data from our dataset.  On dynamic snippets, you will see four different fields that will help you display the data:

  • Snippet Contents: This is the contents of the snippet.  On dynamic snippets, the Snippet Contents are "wrapped" around each record in the linked dataset.  For each record in your dataset, the snippet contents is applied to the record, and then appended to the snippet contents for each previous record. 
  • Snippet Header HTML: This field allows you to enter HTML that will appear before the snippet contents, and is not applied to each dataset record.
  • Snippet Footer HTML:  Similar to Snippet Header HTML, but this fields contents will appear after the snippet contents have been applied to the dataset.
  • Empty Dataset Text: This field gives you the ability to enter text or HTML to display if your dynamic snippet cannot find any matching records in the dataset.  This is helpful to dsiplay text such as "No records could be found", etc.

In this example, we will enter the following code in the "Snippet Contents" field:

<div>#{content}</div>


The #{content} is the syntax used to reference the fields of the linked dataset.  #{contents} will display the text in the contents field.  For a list of the snippet syntax for the fields on your linked dataset, click the "Show Dataset Field Syntax" link.

Enter the snippet contents

For this example, we don't need to enter anything in the Snippet Header HTML or Snippet Footer HTML fields, so we'll skip those. However, we will want a message to display if a record doesn't not exist in the dataset for the current URL.  We'll use the Empty Dataset Text Field.

In the Empty Dataset Text field, enter:

<div><p>#{content}</p></div>


We've entered all the data we need for our example.  Now we'll save our snippet.  Click Ok to save the snippet.

Congratulations!  We've created a dataset and linked it to a dynamic snippet!  The last step is to display the contents in a template.

Step 3: Testing the Dynamic Snippet

Alright, we've finished the complicated part of the tutorial.  We just need to add our snippet to a template, and test it out by creating a page.

Let's create a new template by going to the Markup Factory dashboard, clicking on the Templates module, and selecting "Add Template."

Name the template "Dynamic Data", and for the template contents, enter the following:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <div style="width: 400px"> <div style="float: right; border: 1px solid #000000; margin: 10px; padding: 2px;"> {{include name="dynamic-content"}} </div> {{maincontent}} </div> </body> </html>


Click Ok to save the template.

Next, we need to create a page to test our example.   Go to the markup factory dashboard, click on the Pages module, and select "Add Page." 

For the page title, enter Hello World!.  In the url field, we'll enter the URL in our custom dataset record, /hello-world.  Choose the template we just created, "Dynamic Data", as the page template.  For the page contents, enter:

Welcome to the hello world page!

Click save to save the page.

Ok, lets give this a try!  To test out our dynamic snippet, open your web browser, and navigate to: http://[your-site-url]/hello-world

You should see your dynamic snippet outputting the data from the custom dataset we created!

Hello World!


Feature Update

November 5, 2008 - 6:04 PM

What We've Been Up To

I wanted to take a minute to update you on what we've been working on lately with Markup Factory.

We've been spending a lot of time improving our back-end, page rendering engine, templating engine, and our new MF Database module (currently in beta). This may not sound too exciting to some of you, but this groundwork will have a dramatic effect on what you will be able to create with Markup Factory.

Our main goal in all this is to make every aspect of the website design and presentation accessible to the designer. This includes full control of XHTML output for all of the content and data stored within the system.

Dynamic Snippets

One of the ways that we achieved this was to create a new feature called Dynamic Snippets. This feature is similar to regular Snippets, only you can now load a set of data into you snippet and loop through it to create customized output. For instance, you can create a new Dynamic Snippet called, "Latest News", set it to include any blog posts in a specific category, and then wrap the contents of the posts in HTML of your choosing. You can then insert this snippet into your home page or on a side bar in your template. The best part of all this is that you can do this without any programming, SQL statements, or database connections.Dynamic Snippet Example

Database Module

We are also moving through the development of the amazing new Database Module. We've recently seen a number of sites launch using this feature in some creative ways ranging from a custom eCommerce site with customer order tracking, to a Real Estate listing site, to an online Membership Renewal application. The MF Database Module enables rapid development of simple web applications by enabling you to create a new dataset and then access that dataset through Dynamic Snippets or the Form Builder. We've also built integration with our user module, which enables you to associate data to users. Again, you can create these apps without any custom programming required.

Dataset Example

These two features will be the cornerstone of our rapid application and website development toolbox.

Markup Factory Launched!

June 16, 2008 - 9:19 PM

DashboardI am pleased to announce the launch of the Markup Factory Web Publishing Platform!

We sincerely believe we are breaking new ground on the web with the launch of this extraordinary website utility. We have worked hard over the last several years to develop a web publishing platform that will cater to the needs of today's web designers and content publishers. Our mission is to provide a utility to assist web designers and content managers in building and maintaining websites more effectively. Our approach is to remove much of the heavy lifting usually associated with building a website and to provide an incredibly powerful set of features that require no server side coding to leverage, while still providing the flexibility for creative design and development.

We believe that there will always be a place for custom software development on the web, but the process for creating many websites can be a lot simpler now than it was before. Markup Factory will enable you to produce feature rich websites in a fraction of the time that it might normally take with other content management systems.

Among other features, here are some of the highlights of this new Web Publishing Platform:

  • Powerful Template Engine (supports native XHTML and CSS)
  • On-Board Content Management System
  • Built-In Email Newsletter Engine
  • Built-In Online Store
  • Built-In Calendar
  • Built-In Online Event Registration
  • Built-In Customizable Online Database (currently in beta)
  • Built-In Form Builder (currently in beta)
  • Built-In Podcasting Engine
  • Blogging Engine
  • Hosted Solution

I invite you to take the tour to learn about Markup Factory in more detail. Or if you really want to dig in deep, you might be interested in checking out our online documentation.

With the launch of Markup Factory, web designers can create an account and begin building a website immediately. We are excited to see what you will all create and are looking forward to refining and enhancing Markup Factory as we go along.

I would like to thank everyone for supporting us in these efforts and for providing valuable feedback along the way. Thank you also to everyone who signed up for our launch announcement and waited so patiently while we perfected the system!

Semantic Web Explained

June 3, 2008 - 10:37 PM

Nova Spivack explains the semantic web

This is a fairly technical presentation, but if you're into databases, schemas, and the future of the world wide web, this is fascinating. Some are calling the Semantic Web "Web 3.0".


Nova Spivack at The Next Web Conference 2008 from Boris Veldhuijzen van Zanten on Vimeo.

Web Publishing Platform

May 28, 2008 - 5:50 PM

More than a Blog

Markup Factory is a Web Publishing Platform designed to help people use their talents and abilities to build and manage websites more effectively. Within our platform, we've specifically addressed several key audiences including:

  1. The Web Designer / Developer
  2. The Content Contributor
  3. The Website User

We believe that there is a place for each of these in the process of building and maintaining a relevant web presence.

Design

Canned website templates are a nice thought and do have a place, but there is no substitute for a talented web designer in the process of building a great website. A designer brings personality and appeal to the web presence and matches this with the brand of the organization or individual. An effective web publishing platform should enable a designer to have total creative freedom over the look and feel of the website and in today's day and age, that means total control over the CSS and XHTML output generated by the system.

Development

Beyond the look and feel, an effective web publishing platform should enable a website developer to create rich functionality on the website without having to reinvent the wheel. A Calendar, Blog, Newsletter, Online Store, Podcast, and Small Database Application should not have to be hacked to fit into your content management system. There will always be a place for custom developed applications, but we've reached a level now where only the most unique requirements will demand from-scratch development.

Content

All too often, the web designer or developer gets roped into the process of publishing content to the website. We all know the process. The individual who wants to publish the content sends a detailed email to the web designer. The web designer attempts to interpret these instructions and make the update for the impatient requester. An effective web publishing platform should give direct access to the content contributor and let the designer do what he / she does best: design. In present times, this also means enforcing valid XHTML output on the website even though the content contributor may not be aware this is happening.

User Experience

Users should not need to maintain multiple accounts to interact with the rich functionality on your website. Users should not need to visit one website to view your blog, another to get your podcast, another to purchase from your online store, and yet another to register for your conference. Your are one - your website should be too.

With all of the collective development that Internet professionals have put into the World Wide Web, does it still need to take hundreds of hours to develop a website that can accomplish all of these purposes?

We are looking forward to seeing what our users will create with this new platform. Our aspiration is to work together with you to produce the next generation of websites and to set a new standard for website functionality that will penetrate into every corner of the web.

Addressing Form Spam

May 20, 2008 - 10:06 PM

Enough Already

We've watched the amount of email spam double every six months for the past couple years. Recently, we've seen dramatic increases in the amount of form or comment spam (that is spam that comes through submitted web forms). There are several effective methods of combating form spam that have been developed in recent years including:

  1. CAPTCHA
    The CAPTCHA Project: www.captcha.net
  2. Human Solver
    What is two plus four? 
  3. User Authentication
    You must log in to post a comment. 
  4. Moderation
    "Your comment will be displayed after it is approved by a moderator." 
  5. Content Filtering
    Akismet - www.akismet.com | Mollum - www.mollum.com

There are other methods beyond these and Six Apart does a nice job of outlining most of them as does Site Point. In the coming months and years, I suspect that this will be a moving target (just as email spam has been) and no one method will be perfect. There have been recent exploits of some prominent CAPTCHA systems. We have been very impressed with the accuracy of Akismet and the extremely low number of false positives. I wonder if putting your combat methods out in public in the form of a CAPTCHA is just inviting spammers to crack it. Services like Akismet keep the filtering algorithms behind lock and key so it may be much more difficult for spammers to reverse engineer a system of that type.

We are offering a number of these methods as configurable choices as part of the Markup Factory web publishing platform, including Akismet, possibly Mollum, moderation, and user authentication. As of now, my personal recommendation is to go with Akismet if you have any public forms on your website. I'm looking forward to seeing if the new Mollum service can become an avid competitor of Akismet. Good luck guys!

 

Copyright © 2007 - 2008 Cramer Development. All rights reserved.Terms of ServicePrivacy PolicyFAQContact Us