Download the PHP package manuxi/sulu-article-configuration-bundle without Composer
On this page you can find all versions of the php package manuxi/sulu-article-configuration-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download manuxi/sulu-article-configuration-bundle
More information about manuxi/sulu-article-configuration-bundle
Files in manuxi/sulu-article-configuration-bundle
Package sulu-article-configuration-bundle
Short Description Bundle for extended Article Configuration in Sulu
License MIT
Informations about the package sulu-article-configuration-bundle
SuluArticleConfigurationBundle
๐ฉ๐ช German Version
The SuluArticleConfigurationBundle extends Sulu 3.0 Articles with a comprehensive "Configuration" tab. It allows managing additional display options, features, and publication settings directly on the article.
โจ Features
๐ Display Options
- Layout Style - Choose between Default, Wide, Full Width, or Narrow (Reading Mode)
- Sidebar - Enable/disable sidebar and set position (Left/Right)
- Show Elements - Table of Contents (TOC), Reading Time, Author Box, Related Articles
โ๏ธ Functions & Features
- Interactions - Share Buttons
- Tools - Print Function
๐ Publication Settings
- Metadata - Hide Publish Date
๐จ Styling & Advanced
- Design - Custom CSS classes
๐งฉ Configurable Fields
- Sulu form XML - Add, change or remove fields with plain Sulu form XML in your project, no database change needed
- Per group and per template - Every template can have its own set of fields, see docs/configuration.en.md
๐ Default-Configuration
- Inheritance System - Set a configuration as default for all articles of the same template key
- 3-Tier Cascade - Article-specific โ Template key specific โ default values
- Automatic Template Detection - The template key is automatically detected and stored
๐ Prerequisites
- PHP 8.2 or higher
- Sulu CMS 3.0 or higher
๐ฉ๐ปโ๐ญ Installation
Step 1: Install the package
Add the repository to your composer.json (if local) or install directly:
If you are not using Symfony Flex, add the bundle to config/bundles.php:
Step 2: Configure routes
Add the following to config/routes.yaml to load the Admin API routes:
Step 3: Update the database
Create the required ar_article_configuration table:
๐ฃ Usage
Admin Interface
- Navigate to Articles in the Sulu admin navigation.
- Open an existing article or create a new one.
- Click on the Configuration tab.
- Select the desired options (e.g., "Enable Sidebar", "Layout Style").
- Save the config.
Template Defaults
You can set a configuration as default for all articles with the same template:
- Open an article with the desired template (e.g., "Blog Post").
- Go to the Configuration tab.
- Configure all settings as desired.
- Enable "Use as default" in the "Default Configuration" section.
- Save the config.
Now all other articles with this template will automatically use these settings - unless they have their own configuration.
How the cascade works:
Custom Fields
The fields of the "Configuration" tab are defined with Sulu form XML. The bundle ships the fields listed below; your
project can change them or add its own - for all articles, per article group or per template. Drop the files into
config/article_configuration/ (registered automatically):
The files only contain the differences to the level before. A new <property> adds a field, a property with the
same name replaces it, and <tag name="article_configuration.remove"/> removes it:
Values are stored as JSON, so a new field never needs a schema update. See docs/configuration.en.md for the levels, value types, translations and a complete example.
Frontend Usage (Twig)
The bundle provides a Twig function to access the resolved configuration in your twig templates:
Available configuration values (the fields shipped with the bundle; your schema may add or remove fields, and hardcoded means the schema defaults):
| Property | Type | Default | Description |
|---|---|---|---|
layoutStyle |
string | 'fullwidth' |
default, wide, fullwidth, narrow |
enableSidebar |
bool | true |
Show sidebar |
sidebarPosition |
string | 'right' |
left, right |
showToc |
bool | true |
Show table of contents |
showReadingTime |
bool | true |
Show reading time |
showAuthorBox |
bool | true |
Show author box |
showRelated |
bool | true |
Show related articles |
enableShareButtons |
bool | true |
Show share buttons |
enablePrint |
bool | true |
Show print button |
hidePublishDate |
bool | false |
Hide publish date |
customCssClass |
string | null |
Custom CSS class |
configSource |
string | - | article, template_default, hardcoded |
Example: Conditional sidebar layout
Example: Custom CSS class
Resolving an Article's Template by URL
article_configuration/article_config need the article's own templateKey, which is trivial to pass when you
are already rendering that article's own page. It is not reachable through Sulu's properties mapping on a
smart_content/selection list, though (the field lives in the resource's internal "view" data, which
recursivelyMapProperties() never maps) -- for example an "articles" collection field on a page or a different
article, where each item is only a title/subtitle/url/image, would always miss it.
article_template_key(url, locale) resolves it from the article's frontend URL instead (via the route table),
so it works from exactly that situation. Returns null if the URL does not resolve to a live article.
Combine with your own template-to-color/label mapping (e.g. a project-level color palette) to badge articles by their template in a list -- the bundle only resolves the key, it has no opinion on colors or labels.
โฌ๏ธ Upgrading from 2.x
3.0 stores the values as JSON instead of fixed columns. Make a database backup, then copy the data before the old columns are dropped:
Details and the list of breaking changes: CHANGELOG.md.
โฌ๏ธ Upgrading from 1.x
2.0 removes the PDF switches (enableDownloadPdf, pdfShowCaptions, pdfShowAuthor, pdfShowModified, pdfShowOnlineLink, pdfCompanyData) from the "Configuration" tab. They now live in the excerpt tab of the article, provided by manuxi/sulu-pdf-bundle (1.3+) - per language and with the draft/publish workflow:
Replace articleConfig.enableDownloadPdf in your templates with sulu_pdf_available('articles', uuid, app.request.locale), run bin/adminconsole doctrine:schema:update --force to drop the columns and set the switches again in the excerpt tab.
๐๏ธ Database Schema
The bundle creates the following table:
๐งช Testing
๐ License
This bundle is under the MIT license. See the complete license in the bundle: LICENSE
๐ค Author
Manuel Bertrams
- GitHub: @manuxi