<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="https://blog.aabech.no/rss/xslt"?>
<rss xmlns:a10="http://www.w3.org/2005/Atom" version="2.0">
  <channel>
    <title>Lars-Erik's blog</title>
    <link>https://blog.aabech.no/</link>
    <description>Ramblings about Umbraco, .net and JavaScript development. With a sprinkle of other stuff.</description>
    <generator>Articulate, blogging built on Umbraco</generator>
    <item>
      <guid isPermaLink="false">1167</guid>
      <link>https://blog.aabech.no/archive/search-and-rss-for-our-umbraco-contentlist/</link>
      <category>umbraco</category>
      <title>Search and RSS for our Umbraco ContentList</title>
      <description>&lt;p&gt;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 &lt;a href="//blog.aabech.no/archive/our-umbraco-community-contentlist-10-beta-released/"&gt;initial release post&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Theme control&lt;/h2&gt;
&lt;p&gt;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: &lt;code&gt;list.json&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;There are two options you can add to the list config file:&lt;/p&gt;
&lt;h3&gt;Compatible sources&lt;/h3&gt;
&lt;p&gt;To specify which data sources a theme goes well with, add a &lt;code&gt;compatibleSources&lt;/code&gt; array:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{
    &amp;quot;compatibleSources&amp;quot;: [
        &amp;quot;ListablesByLuceneDataSource&amp;quot;,
        &amp;quot;ListableByNodeDataSource&amp;quot;,
        &amp;quot;ListableChildrenDataSource&amp;quot;
    ] 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Disable columns setting&lt;/h3&gt;
&lt;p&gt;The &lt;a href="https://github.com/lars-erik/Our.Umbraco.ContentList/tree/master/Our.Umbraco.ContentList.Web/Views/Partials/ContentList/FlexTheme"&gt;FlexTheme&lt;/a&gt; example view for instance does its own flexbox styling with varying amounts of columns. For this theme, the columns setting with &amp;quot;mobile&amp;quot;, &amp;quot;tablet&amp;quot; and &amp;quot;desktop&amp;quot; column counts make no sense. &lt;/p&gt;
&lt;p&gt;You can now disable the columns setting as such:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{
    &amp;quot;disableColumnsSetting&amp;quot;: true
}
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Search&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;ListableByLuceneDataSource&lt;/code&gt; have gotten a small brushup. The query setting have gotten its textbox expanded for better UX, and a new parameter called &amp;quot;Fulltext Querystring Parameter&amp;quot; have been added.&lt;/p&gt;
&lt;p&gt;The latter will combine the &amp;quot;query&amp;quot; with a search in all fields for all terms in a phrase extracted from the querystring parameter specified in the setting.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.aabech.no/media/1036/contentlist-search-datasource-settings.png" alt="New parameters in the lucene data source" /&gt;&lt;/p&gt;
&lt;p&gt;There is a &lt;a href="https://github.com/lars-erik/Our.Umbraco.ContentList/tree/master/Our.Umbraco.ContentList.Web/Views/Partials/ContentList/SearchResult"&gt;new sample template for search&lt;/a&gt; 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 &lt;a href="https://github.com/lars-erik/Our.Umbraco.ContentList/blob/38a65b9d7f43fec69340ffa31192bd759869fb86/Our.Umbraco.ContentList.Web/Config/grid.editors.config.js#L51"&gt;a grid editor&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.aabech.no/media/1037/contentlist-search-output.png" alt="Example output of search data source" /&gt;&lt;/p&gt;
&lt;h2&gt;Rss&lt;/h2&gt;
&lt;p&gt;I didn't want to bundle RSS with the core component, so there's a new package on the block called &lt;code&gt;Our.Umbraco.ContentList.Rss&lt;/code&gt;. By installing it, you get another data source aptly called &amp;quot;Rss&amp;quot;. It's also currently in beta, so remember to add the &lt;code&gt;-pre&lt;/code&gt; option when installing.&lt;/p&gt;
&lt;p&gt;It has one parameter for the URL to the RSS-feed, so I gather it doesn't need that much documentation. &lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;Hope y'all enjoy and find this stuff useful! Don't be shy, come over to &lt;a href="https://github.com/lars-erik/Our.Umbraco.ContentList"&gt;the github repo&lt;/a&gt; and post issues if you want to discuss, ask questions or (please do) contribute.&lt;/p&gt;
</description>
      <pubDate>Wed, 06 May 2020 13:30:33 Z</pubDate>
      <a10:updated>2020-05-06T13:30:33Z</a10:updated>
    </item>
  </channel>
</rss>