Articles
The OWArticleSettings class is designed to handle all article-related configurations. It enables publishers to specify how article metadata is fetched, customize its display, and configure additional settings for enhanced control.
Key Features
- Support for server-side and local article metadata strategies.
- Customizable section and header options.
- Ability to enable or disable Read-Only Mode for conversations.
Article Settings
The OWArticleSettings class encapsulates the article’s metadata and configuration. It includes the following key properties:
Article Information Strategy
The articleInformationStrategy property defines how article metadata is fetched:
- Server Strategy: Metadata is automatically fetched from the OpenWeb server.
- Local Strategy: Metadata is defined locally using the
Articleobject.
Example:
val articleSettings = OWArticleSettings(
articleInformationStrategy = OWArticleInformationStrategy.Local(
Article(
url = "https://example.com/article",
title = "Sample Article",
subtitle = "An example of local article metadata"
)
)
)
Additional Settings
The OWArticleAdditionalSettings class provides further customization options:
- Section - Define a specific section for the article, such as "Technology" or "Sports." This is often used for categorization purposes.
- Header Style - Control the visibility and style of the article header using
OWArticleHeaderStyle. Options include:Regular: Display the header as usual.None: Hide the header entirely.
- Read-Only Mode - The
readOnlyModeproperty determines whether users can interact with the conversation:SERVER: Default behavior determined by the server configuration.ENABLE: Force Read-Only Mode.DISABLE: Allow full interactivity.
- Star Rating - The
starRatingproperty activates the Social Review feature.
Example:
val additionalSettings = OWArticleAdditionalSettings(
section = "Technology",
headerStyle = OWArticleHeaderStyle.Regular,
readOnlyMode = OWReadOnlyMode.ENABLE,
starRating = true
)
Updated 3 months ago
