Page tree
Skip to end of metadata
Go to start of metadata

The ParagraphLengthAuditor checks the length in words of HTML elements containing text, not the overall length in characters. You can use this auditor to check for pages with overly long text blocks. This can any HTML element that containing text which can be located by a jsoup query.

Class: info.magnolia.services.seo.audit.impl.ParagraphLengthAuditor

In addition to the common auditor properties, this auditor can be configured with the following properties:

level

required

Determines how a failed audit will be counted:

  • Error (auditErrors)
  • Warning (auditWarnings)
  • Note (auditNotes)

auditProperty

required

Defines the property name for storing failed audit results.

(warning) The property name should be unique among auditors or auditors may overwrite results.

auditValue

required

Defines a message or explanation for a failed audit.

The message can have placeholders that are replaced with information about the node and auditor:

  • 0 - node path
  • 1 - configured query property
fetcher

required

(warning) Added in v5.6.2

Defines the content fetcher for the selected node. The fetched content is then scanned for links.

There are two types of content fetchers available, for more about content fetchers, see: Content Fetchers.

query

optional

A valid jsoup query. See this cookbook for more on jsoup queries.

maxWords

optional

Defines the maximum number of words allowed in the text block. If not specified, then the limit will be 150.

Example

Here is an example from the SEO module. You can find this configuration here: /modules/seo/config/auditManager/auditors/excessivePageText

excessivePageText: 
  auditProperty: excessiveText
  auditValue: The page {0} contains {1} paragraphs that are too long
  class: info.magnolia.services.seo.audit.impl.ParagraphLengthAuditor
  description: Check if any paragraph is too long (pre-prod)
  level: auditWarnings
  fetcher: 
    class: info.magnolia.services.seo.audit.impl.RequestFetcher
    targets: 
      localhost: 
        class: info.magnolia.services.seo.audit.impl.HostTarget
        host: localhost
        password: superuser
        port: 8080
        scheme: http
        user: superuser
  • No labels