N.B. This article refers to the legacy application Publish, used in versions below 8.1.
In modern versions, the Pages application has effectively replaced the need for Publish.
Continue reading if you are using Publish and wish to implement this smart object.
Before proceeding, please read the overview of smart objects and components here.
Copy and paste the code below into a publish template.
<component class="BlogPostsComponent" show_tools="1" show_comments="1" max_number="3" max_comment_length="64" max_length="64" auto_channels="all" template="blog/blog_posts_component.html">
The component must be placed within a publish template and not within a publish page.
The list can be controlled by modifying certain parameters.
channels: - comma-separated list of blog channels IDs. If not given, displays subscribed channels
auto_channels: automatically pick channels to show, possible values are 'own', 'user', 'subscribed' ('user' means show all blogs of the user specified in 'user_id' attribute)
user_id: has effect only if auto_channels="user", user ID whose blogs to show for example user_id="1,2,3"
show_tools: Show links to view all news articles and create new articles.
show_comments: The number of recent comments to display. The default is 0, meaning no comments will be displayed.
max_length: Defines number of characters to display of the abstract/summary text (0 = no constraint). If not defined, $cfg_headline_news_text_truncate is used
max_comment_length - Defines max number of characters to displayof the comments under the blog (New Since 7.4.7)
max_number: Maximum number of blog articles to display. If not defined, the maximum defined in the Claromentis configuration file will be used ($cfg_headline_news_number).
template="blog/blog_posts_component.html": This is the default template used for the list. Do not change unless custom styling is being used.