Entry Summary - WeTeam/WeBlog GitHub Wiki

Generating Entry Summaries

The summary displayed for a post on a list page (blog list page, category list page, tag list page) is generated using the weblogGetSummary pipeline defined in the App_Config\Include\WeBlog.config configuration patch file.

The pipeline passes an argument of Sitecore.Modules.WeBlog.Pipelines.GetSummary.GetSummaryArgs between the pipeline processors. The following list describes the properties of the argument.

Entry: Gets or sets the EntryItem the summary is being generated for
Summary: Gets or sets the summary for the EntryItem

Any of the processors may manipulate the Summary property as appropriate.

To minimise processing it is wise to first check within a GetSummary processor that the summary is still empty. If it is, then continue processing. If the summary is populated, do not execute the processor. To assist implementing this pattern the Sitecore.Modules.WeBlog.Pipelines.GetSummary.GetSummaryProcessorBase class is used as a base class for the processors. The custom processor logic is implemented in the GetSummary() method.

The GetSummary pipeline is executed using the Sitecore.Pipelines.CorePipeline class and GetSummaryArgs inherits from Sitecore.Pipelines.PipelineArgs, so calling the AbortPipeline() method on the GetSummaryArgs instance may terminate the pipeline and bypass and remaining processors (depends on the value of the RunIfAborted property of the pipeline processor, which is false by default).

Processors

WeBlog contains the following pipeline processors which can be arranged in any fashion and order.

AutoGenerate

FQN: Sitecore.Modules.WeBlog.Pipelines.GetSummary.AutoGenerate, Sitecore.Modules.WeBlog
Purpose: Auto generates a summary from a field, optionally stripping tags.

Properties

MaximumCharacterCount: (int) Defines the maximum number of characters to include in the summary.
StripTags: (bool) Determines if tags should be stripped from the field content and only the textual content used.
MoreString: (string) The text to add to the end of the summary if the field was truncated
FieldName: (string) The name of the field to pull the content from

FirstContentBlock

FQN: Sitecore.Modules.WeBlog.Pipelines.GetSummary.FirstContentBlock, Sitecore.Modules.WeBlog
Purpose: Extracts the summary as the content before a specified delimiter element from a specified field.

Properties

XPath: (string) An XPath expression to select the delimiting element.
FieldName: (string) The name of the field to pull the content from

FromField

FQN: Sitecore.Modules.WeBlog.Pipelines.GetSummary.FromField, Sitecore.Modules.WeBlog
Purpose: Uses a field of the EntryItem as the summary

Properties

FieldName: (string) The name of the field to pull the content from