Mapping Urls to Content

For any incoming request for a content-managed page, Lynicon goes through a specific procedure to map the url onto the content item required.  For a request to be handled by Lynicon, its url must match a DataRoute in terms of its format.  Special url parameters are then extracted.  Taken together these parameters form an index into the content items of a specific type held in the Data API. Here are the most common forms:

articles
articles/{_0}
articles/{_0}/{_1}

The special url variables take the form {_<number>} where the number indicates the ordering of the indexes.  The first example would be a url /articles, where there was only one page of the appropriate type (which might, say, be ArticleContent).  The second example has one index, so it would match any url like /artcles/some-article.  The third exmaple has two indexes, so it would match something like /articles/article-group/some-article.

Once Lynicon has determined the indexes it then attempts to find a content item which matches these indexes.  Exactly how this is done depends on the code in the Collator registered for the appropriate content type.  For the ContentCollator, it simply concatenates the indexes (with a separator to avoid ambiguities) and looks for a ContentItem container record whose property Path matches this string. For the BasicCollator, it can match the different indexes against different properties on the content record.

If an appropriate content item is found, the DataRoute attaches this item to the RouteData for the request and returns a match to the routing system. Otherwise it returns a matching failure, and routing will continue to try and match to the next route.

This behaviour allows for a situation where the same url pattern can map to multiple content types.

You can vary the url of a content item arbitrarily and set up redirects to it by using the Url List module