Sitemason V URLs Explained

Table of contents

There are two parts to a Sitemason URL. The first part identifies what tool to display, like http://www.sitemason.com/form/gOiHHq or http://pirate.monkeyness.com/pirate_fight/apply. Everything after that in the URL is passed as parameters to the tool being called. Parameters in the path of the URL determine the layout that is used and how XML data is formatted. They also define the constraints for how many items are retrieved and what offset to use when retrieving those items. Parameters in the query string specify searches that narrow down the results that are displayed.

Identifier

In old Sitemason, the non-vhost address started with the tool's name and a six character id. In new Sitemason, all non-vhost addresses start with "/element" followed by a seven character id, specially designed to not have confusing characters. You will not find a one (1) or lowercase L (l) and since no uppercase characters are used, you will not have a capital O to conflict with a zero (0).

Path Parameters

In old Sitemason, each tool used different notation and different parameters; There was no consistency. Many of the parameters were passed in the query string, the part after the ?, making it difficult to cache content and making it less appealing to search engines. In new Sitemason, all the tools use the same notation and same parameters and most parameters are specified in the path. Only search parameters are in the query string.

The first parameter is the "view". It determines the tool template and the format of the XML. Everything following the view and before the query string is the "span". The span determines the range of items to display.

/element/{id}/{view}/{span}

View

Views are designated by using the words, "cal_grid", "cal_list", "list", etc. in the URL as listed below. The valid "spans" are listed for each view.

  • cal_grid - Calendar grid with items linked to detail pages.
spans - date
  • cal_list - List of items in logical time chunks, like day, week, month with items linked to detail pages.
spans - date
  • list - List of titles/headlines with items linked to detail pages.
spans - days, set
  • rss, podcast, photocast - RSS feed
spans - days, set
  • ics - iCalendar format
spans - date, days, set, title, id
  • detail - A single item. "detail" may be omitted in the URL. If Sitemason sees a year, "id", or "time_id" in the spot for view, it assumes it is a detail view.
spans - title, id, time_id
  • email - Not sure
  • summary - List with summaries with items linked to detail pages.
spans - days, set
  • full - List with bodies and no detail links.
spans - days, set

Span

Spans come after the view and come in a variety of formats. There is a name for each format, but it doesn't necessarily show up in the URL.

  • title - Displays one item based on a WordPress-style URL. This is good for search engines and is used by default. The {id} is there to prevent conflicting URLs from to items with the same title in the same day, which is likely with events. {page} is optional for specifying which page of a multi-page item.
/{year}/{month}/{day}/{title}.{id}/{page}
/2007/8/20/some-article.53 - shows item "Some Article" with id 53, page 1
/2007/8/20/some-article.53/2 - shows item "Some Article" with id 53, page 2
  • id - Displays one item by id. This is good for a permanent URL, since it doesn't change if the title changes.
/id/{id}/{page}
/id/53 - shows item 53, page 1
/id/53/2 - shows item 53, page 2
  • time_id - Displays one item by its time id. This is good for pulling up one occurrence of a repeating event and is good for a permanent URL, since it doesn't change if the title changes.
/time_id/{time_id}/{page}
/time_id/134 - shows item 134, page 1
/time_id/134/2 - shows item 134, page 2
  • set - Displays a fixed number of items. The starting point is determined by settings in the tool. It may start from now or from the beginning of the items and may go forward in time or backwards. {limit} is the number that should be displayed. {offset} is how many items from the starting point it should display.
/set/{limit}/{offset}
/set/30 - shows 30 items starting from the start.
/set/30/60 - shows 30 items starting at the 60th.
  • days - Displays a number of days-worth of items. This has not been implemented yet.
/days/{days}/{offset}
/days/3 - shows 3 days worth of items starting from the start.
/days/3/6 - shows 3 days worth of items starting at the 6 day from the start.
  • date - Displays all items from a logical unit of time. Week uses "1st", "2nd", "3rd", "4th", "5th", "6th" and runs from Sunday through Saturday. It will include days from the previous or next month, to provide the full week.
/{year}/{month}/{week|day}
/2007 - shows all of 2007
/2007/8 - shows all of August 2007
/2007/8/2nd - shows the second week of August 2007
/2007/8/20 - shows August 20th, 2007

Query String Parameters

In new Sitemason, the query string, the part of the URL after the ?, is used for search parameters. There are two types of searching. There is a general search that intelligently parses a search field, much like using the search field in Google and there are specific searches that let you search individually on most of the fields of data.

General Search

The general search attempts to parse search text passed to Sitemason as a single string of text. Sitemason tries to recognize formatted information in the search string in the following order.

  1. Quoted text - search words in quotes are treated as a phrase search.
  2. Tags - matches on tags.
  3. Time keywords
    • today/tomorrow/yesterday
    • this/next/last weekend/week/month (e.g.: next week)
    • [next/last] # days/weeks/months [ago] (e.g.: next 5 weeks, 2 months ago)
    • future
  4. Word date - January 1 or January 1-2 or Sunday, January 1st, 2008
  5. Formal date - 1 of January or Sunday, 1st of January, 2008
  6. Year first date - 2005-1-1 or Sunday, 2005/01/01
  7. Month first date - 1/1 or Sunday, 01-01-2008
  8. Month, year date - January or Jan 2008
  9. Year-only date - 2008
  10. Content word search - Look up individual words within the title, abstract, body, and custom fields.

The general search may be passed in a field named "q" and for compatibility with older Sitemason tools, "search" or "search_string". Any of the three will work, but "q" takes precedence if more than one of the fields is present. To search for "pirate", use a query string of "?q=pirate" or submit a form with a field named "q" and a value of "pirate".

Example for grabbing the a time range from "yesterday" through the "next 2 days":

http://www.domain.com/page_name/?q=yesterday to next 2 days

Specific Search

Specific searches allow you to be very selective about what results are returned. The following are some of the fields available for specific searches. Unless specified otherwise, these searches are inclusive, using "OR".

  • tags - All items that have tag1 or tag2 OR matches any other search criteria. Usually, you want the tags to limit the search and this doesn't, so this isn't used very often. This will return the most items.
  • xtags (eXclusive tags) - All items that have tag1 or tag2 AND matches any other search criteria. Tags limit what you are searching on, but items just need one of the tags and fit the search to qualify. This is the most common usage.
  • xatags (eXclusive And tags) - All items that have tag1 and tag2 AND match other search criteria. Items must have all the tags. This can be useful for categories or hierarchies where a sub-tag might not be descriptive enough on its own. It is the most specific and limiting search.
  • xtag_id_list - exclusive search on tag ids.
  • tag_id_list - inclusive search on tag ids.
     

Example
thing 1 - hat, blue
thing 2 - hat, red
thing 3 - scarf, blue
product 4 - scarf, red
thing 5 - socks

tags=hat&tags=blue&q=thing
    Any hats, blue items, or items matching "thing": all but 4
xtags=hat&xtags=blue&q=thing
    Any hats or blue items that also match "thing": 1, 2, 3
xatags=hat&xatags=blue&q=thing
    Any hats that are blue and match "thing": only 1

  • id_list.id
  • id_list.content_type_id - '1' for articles only, '2' for events only
  • id_list.tag_index_id
  • id_list.comment_list_oid
     
  • flags.is_approved - searches prefixed with 'flags' are specified with a one or a zero.
  • flags.is_lead_item
  • flags.is_important
  • flags.is_archived
  • flags.is_new_option
  • flags.is_updated_option
  • flags.should_include_in_digest
  • flags.is_live
     
  • when.start_time.start
  • when.start_time.end - This searches on the start time if there is no date range or on the end time if there is a date range.
  • when.creation_timestamp.start
  • when.creation_timestamp.end
  • when.modified_timestamp.start
  • when.modified_timestamp.end
     
  • xwhat.title - Searches prefixed with 'xwhat' perform exclusive word searches within the given field.
  • xwhat.title_encoded
  • xwhat.summary
  • xwhat.description
  • xwhat.alternate_url
  • xwhat.custom_field_1
  • xwhat.custom_field_2
  • xwhat.custom_field_3
  • xwhat.custom_field_4
  • xwhat.custom_field_5
  • xwhat.custom_field_6
  • xwhat.custom_field_7
  • xwhat.custom_field_8
     
  • what.[field] - Searches prefixed with 'what' perform inclusive word searches within the given field.
  • what.title
  • what.title_encoded
  • what.summary
  • what.description
  • what.alternate_url
  • what.custom_field_1
  • what.custom_field_2
  • what.custom_field_3
  • what.custom_field_4
  • what.custom_field_5
  • what.custom_field_6
  • what.custom_field_7
  • what.custom_field_8
     
  • xbegins.[field]=[0-9a-z] - Returns items where the given field begins with the given number or letter.

Sorting

Sorting can be defined by using one or more "sort" arguments in the form of "sort={field}". Additionally, you can specify the sort order by adding "asc" for ascending or "desc" for descending separated by a comma, as in "sort=title,desc". "asc" is the default for any field. An example of multiple sort criteria is "sort=is_lead_item,desc&sort=title,asc".

There are two specialty sorts, popularity and random. Popularity has some extra requirements to enable it since every time an article/event is requested it makes a separate call to increment a counter for that article/event. Contact support for more info.

The random sort preempts any other sorts you define. Simply use "sort=random" to get a random list of articles or events. You can use any of the view/span combinations aside from detail. For instance, "/list/set/5?sort=random" will give you 5 random items. "/2010/07?sort=random" will give you all events from July 2010 in random order. This is an especially useful feature for sidebar content where you need to pull a random item, like a quote, out of a set of hundreds, because you don't have to grab everything and then pick one at random. For slideshows, you could pull enough random items to display for a reasonable amount of time, like 50, out of a list of thousands.

The following is a list of sortable fields.

  • is_approved
  • is_lead_item
  • is_important
  • is_new_option
  • is_updated_option
  • should_include_in_digest
  • start_time
  • create_timestamp
  • modify_timestamp
  • archive_timestamp
  • title
  • title_encoded
  • subtitle
  • summary
  • description
  • alternate_url
  • custom_field_1
  • custom_field_2
  • custom_field_3
  • custom_field_4
  • custom_field_5
  • custom_field_6
  • custom_field_7
  • custom_field_8
  • origin_instance_id
  • origin_item_id
  • origin_source_url
  • origin_guid
  • editor_name
  • editor_email_address
  • image_align
  • counter
  • popularity
  • feed_subscription
  • random

 

110 30th Ave North, Suite 5 | Nashville, TN 37203 | 615-301-2600 | 888-349-5578