Skip to content
Shannon Deminick edited this page Aug 8, 2015 · 7 revisions

During application startup you can configure various options for Articulate. This is done by creating your own instance of Umbraco.Core.ApplicationEventHandler and then overriding the ApplicationStarted method. In that method you can set your own Articulate.Options.ArticulateOptions class which will be used to initialize the Articulate engine. Example:

public class MyEventHandler : ApplicationEventHandler
{
    protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
    {
        ArticulateOptions.Setup(
            new ArticulateOptions(
                autoGenerateExcerpt: true,
                generateExcerpt: s => s.TruncateAtWord(150)));
    }
}

Available options

All options are specified in the constructor of the ArticulateOptions instance passed to the Setup method. The options are:

autoGenerateExcerpt

True/false (default is true). If the Excerpt field is empty, this will be auto generated based on the content of the blog post. When this is true it will use the generateExcerpt option to create the value.

generateExcerpt

This is the method that creates the excerpt if autoGenerateExcerpt is true and the excerpt field is empty. The default method will: strip the html, decode any html markup, strip blank/new lines, truncate at words with a length of 200 chars.

RssFeedGenerator

Controls how the RSS feeds are generated. This allows you to customize the RSS feed output.

This option cannot be set via constructor parameters. Instead you can create your own Rss feed generator class that inherits from the Articulate.Syndication.RssFeedGenerator class and override any methods you need in order to customize the feed output. Alternatively you can implement the entire RSS feed generation manually by creating a class that implements Articulate.Syndication.IRssFeedGenerator.

Then you can create your own options class that inherits from Articulate.Options.ArticulateOptions, override the GetRssFeedGenerator method and return your custom implementation.

Reading options

The options specified can be accessed by:

 UmbracoConfig.For.ArticulateOptions()
Clone this wiki locally