Getting Started

Since XMod is so flexible, it can be a bit confusing for new users. This topic should provide a foundation you can use as you explore XMod's capabilities.

 

At its root, there are 2 parts to an XMod solution: Data-entry forms, used for adding and editing your data; and display templates, used for displaying that data to the user. Although XMod allows you to create numerous solutions for your site, it's easiest if we start with a specific example. Imagine that you want to create a news module. You or your news person would gather news from various sources and create news stories that your site visitors would read. To do this, you'll need to create a few things:

 

  1. Data-Entry Form: You need a way to enter your news stories into the database. This form would probably have input boxes for the Title, Author, Synopsis, and the Full Story.
  2. Headline View: Most sites will display a list of news headlines on their front page. When the user sees a headline of interest, he/she clicks the headline and is taken to the full news story.
  3. Full Story View: This is the full news story the user sees after clicking on a headline.

 

This same 3-part model is used by many sites - for news, product listings, and more. XMod is structured to make this kind of model easy to build. It isn't the only thing you can do with XMod, but it's the most common. A typical XMod solution consists of three things:

 

  1. Form: This is the data-entry form from our news example above. You need some way to get the data into the system. Forms tell XMod which controls to present to the user. If you were creating the news module, you would have a text box for the Title, one for the Author, a textarea box for the Synopsis, and perhaps an HTML input box for the FullStory.

    A form is text that describes what controls you want on your form. You can create forms by hand using any text editor (or XML editor), but the quickest and easiest way is to use the Form Builder. Using the form builder, you can create a typical form within minutes. Forms are built using XMod form controls

    For an example of creating a form, view Walkthrough: Creating a Form
     
  2. ListView Template: This corresponds to the "Headline View" from our news example. When you want to present the user with a list of records in your database (i.e. news headlines), you create a ListView template which tells XMod which fields from your form you want to display and how XMod should format them.

    To do this, you'll typically mix HTML tags a number of special XMod tags. The most frequently used of these special tags is the <xmod:field> tag. At a basic level, this tag acts as a placeholder. At "run-time" the tag is replaced with the contents of that field for each record that XMod displays. This tag also provides a handy attribute detaillink which will automatically create a link to the DetailView (see #3) for the record. This makes it very easy to setup a headlines type of display.

    In the ListView template, you describe how a single record should be displayed. XMod then repeats that layout for all the other records it's displaying in the list. So, to display our headlines, all you would need to have in your template is:

    <xmod:field name="Title" detaillink="true" />


    With the template above, we're telling XMod to display contents of the "Title" field and turn those contents into a hyperlink which links to the full news story (DetailView template - see #3).
     
  3. DetailView Template: This corresponds to the "Full Story View" in our news example. If the user clicks on a headline, they'll expect to see a more detailed view of the item. As with the ListView template, you mix HTML tags and special XMod tags to tell XMod how your data should be displayed.

    The DetailView template and ListView template are equivalent for the most part. The main difference is that ListView templates accept some tags that apply to the list of records as a whole. Since the DetailView template is intended to only display one record, those additional tags aren't needed. If you wanted to, you could use a DetailView template in place of the ListView template. So, a ListView doesn't always have to display headlines-type listings. You are in control. If you want the full contents of each record (or some subset) to be displayed in the list, you can do it.
     

 

For More Information:

Installing and Using the Starter Packages (XMod 4.7 and above)

Walkthrough: Creating a Form
Walkthrough: Creating a Template

Form & Template Exchange: At our support site, you can download display templates and forms. Some of them are complete applications, others provide examples of techniques. All of them are available for free.