Search and RSS for our Umbraco ContentList

Books I read
See all recommendations

The ContentList package have gotten a few new improvements over the last couple of weeks. Here's a rundown on what's new since the initial release post.

Theme control

Often a theme is customized to work well with just one or a few of the data sources. This is especially relevant with the changes described later in this post. Also, a theme might not use bootstrap, and as such not have the same rigid column count structure. Themes have therefore got a new config file you can choose to add to a theme folder: list.json.

There are two options you can add to the list config file:

Compatible sources

To specify which data sources a theme goes well with, add a compatibleSources array:

{
    "compatibleSources": [
        "ListablesByLuceneDataSource",
        "ListableByNodeDataSource",
        "ListableChildrenDataSource"
    ] 
}

Disable columns setting

The FlexTheme example view for instance does its own flexbox styling with varying amounts of columns. For this theme, the columns setting with "mobile", "tablet" and "desktop" column counts make no sense.

You can now disable the columns setting as such:

{
    "disableColumnsSetting": true
}

Search

The ListableByLuceneDataSource have gotten a small brushup. The query setting have gotten its textbox expanded for better UX, and a new parameter called "Fulltext Querystring Parameter" have been added.

The latter will combine the "query" with a search in all fields for all terms in a phrase extracted from the querystring parameter specified in the setting.

New parameters in the lucene data source

There is a new sample template for search where a search box is included in the theme list view. It posts and controls the configured querystring parameter. You can of course also just make a form in your layout posting to a given page with a content list. Or even a grid editor.

Example output of search data source

Rss

I didn't want to bundle RSS with the core component, so there's a new package on the block called Our.Umbraco.ContentList.Rss. By installing it, you get another data source aptly called "Rss". It's also currently in beta, so remember to add the -pre option when installing.

It has one parameter for the URL to the RSS-feed, so I gather it doesn't need that much documentation.

By specifying some theme settings as described earlier, it should be fairly simple to control both RSS and search themes combined with whatever other creative lists you come up with.

Hope y'all enjoy and find this stuff useful! Don't be shy, come over to the github repo and post issues if you want to discuss, ask questions or (please do) contribute.

Author

comments powered by Disqus