Download the PHP package itech-world/sulu-article-twig-extension-filter-bundle without Composer
On this page you can find all versions of the php package itech-world/sulu-article-twig-extension-filter-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download itech-world/sulu-article-twig-extension-filter-bundle
More information about itech-world/sulu-article-twig-extension-filter-bundle
Files in itech-world/sulu-article-twig-extension-filter-bundle
Package sulu-article-twig-extension-filter-bundle
Short Description SuluArticleTwigExtensionFilterBundle extends the Sulu CMS to enable article retrieval in TWIG without ElasticSearch
License MIT
Informations about the package sulu-article-twig-extension-filter-bundle
Article Twig Extension Filter Bundle for Sulu
Developed by Steeven THOMAS
ArticleTwigExtensionFilterBundle extends the Sulu CMS to enable article retrieval in TWIG without ElasticSearch
📂 Requirements
- PHP ^8.2
- Sulu ^3.0
🛠️ Features
- TWIG extension
sulu_article_load_by_uuid allowingan article to be retrieved by its identifier - TWIG extension
sulu_article_count_publishedfor counting the number of published articles - TWIG extension
sulu_article_load_recentallowing you to retrieve the latest recent articles - TWIG extension
sulu_article_load_recent_paginatedallowing you to retrieve the latest recent articles with pagination
📝 Installation
Composer
Symfony Flex
If you don't use Symfony Flex, you can add the bundle to your config/bundles.php file:
Instructions
Retrieve an item using its UUID
Use sulu_article_load_by_uuid.
Possible parameters:
uuid: The UUID of the articlelocale: The locale of the article
Count the number of published articles
Use sulu_article_count_published.
Possible parameters:
locale: The locale of the articlefilters: An array of filters to apply to the query
Retrieve the latest recent articles
Use sulu_article_load_recent.
Possible parameters:
limit: The number of articles to retrievetemplateKeys: An array of template keys to filter the articleslocale: The locale of the articleignoreWebspace: Ignore webspace and return all articlescategoryKeys: An array of category keys to filter the articlestagNames: An array of tag names to filter the articleswebspaceKeys: An array of webspace keys to filter the articles (only ifignoreWebspaceis false)
Retrieve the latest recent articles with pagination
Use sulu_article_load_recent_paginated.
Possible parameters:
limit: The number of articles to retrieveoffset: The offset of the articles to retrievetemplateKeys: An array of template keys to filter the articleslocale: The locale of the articleignoreWebspace: Ignore webspace and return all articlescategoryKeys: An array of category keys to filter the articlestagNames: An array of tag names to filter the articleswebspaceKeys: An array of webspace keys to filter the articles (only ifignoreWebspaceis false)
Returned Data Structure
All functions return articles as arrays with the following properties:
| Property | Type | Description |
|---|---|---|
uuid |
string | Unique identifier of the article |
id |
int | Database ID |
title |
string | Article title |
description |
string | Excerpt description (from "Excerpt & Taxonomies" tab) |
excerptTitle |
string | Excerpt title (from "Excerpt & Taxonomies" tab) |
excerptMore |
string | "Read more" text (from "Excerpt & Taxonomies" tab) |
url |
string|null | Article URL |
template |
string|null | Template key used |
stage |
string | Publication stage (live, draft) |
locale |
string | Article locale |
published |
DateTime|null | Publication date |
workflowPlace |
string | Workflow status |
categories |
Collection | Categories (from "Excerpt & Taxonomies" tab) |
tags |
Collection | Tags (from "Excerpt & Taxonomies" tab) |
created |
DateTime | Creation date |
changed |
DateTime | Last modification date |
content |
array | All template data (custom fields from your XML template) |
Examples of usage
Create a templates/articles.html.twig file with the following content:
Note : Replace article-template-key with the key of your XML template.
For pagination, you can create an AJAX route in a Controller and use ItechWorld\SuluArticleTwigExtensionFilterBundle\Service\ArticleService.
Example:
🐛 Bug and Idea
See the open issues for a list of proposed features (and known issues).
💰 Support me
You can buy me a coffee to support me this plugin is 100% free.
👨💻 Contact
📘 License
This bundle is under the MIT License.