elvandar / kazetenn-pages
A page handling bundle for symfony. Part of the Kazetenn project
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: 8.1.*
- ext-json: *
- composer/package-versions-deprecated: 1.11.99.4
- doctrine/annotations: 1.13.*
- doctrine/doctrine-bundle: 2.7.*
- doctrine/doctrine-migrations-bundle: 3.2.*
- doctrine/orm: 2.12.*
- elvandar/kazetenn-admin: 1.*
- elvandar/kazetenn-core: 1.*
- elvandar/kazetenn-users: 1.*
- phpdocumentor/reflection-docblock: >=5.2
- stof/doctrine-extensions-bundle: >=1.7
- symfony/asset: 6.2.*
- symfony/console: 6.2.*
- symfony/dotenv: 6.2.*
- symfony/expression-language: 6.2.*
- symfony/flex: 2.2.*
- symfony/form: 6.2.*
- symfony/framework-bundle: 6.2.*
- symfony/http-client: 6.2.*
- symfony/intl: 6.2.*
- symfony/mailer: 6.2.*
- symfony/mime: 6.2.*
- symfony/monolog-bundle: 3.*
- symfony/notifier: 6.2.*
- symfony/process: 6.2.*
- symfony/property-access: 6.2.*
- symfony/property-info: 6.2.*
- symfony/proxy-manager-bridge: 6.2.*
- symfony/runtime: 6.2.*
- symfony/security-bundle: 6.2.*
- symfony/serializer: 6.2.*
- symfony/string: 6.2.*
- symfony/translation: 6.2.*
- symfony/twig-bundle: 6.2.*
- symfony/uid: 6.2.*
- symfony/validator: 6.2.*
- symfony/web-link: 6.2.*
- symfony/yaml: 6.2.*
- twig/extra-bundle: 3.4.*
- twig/twig: 3.4.*
Requires (Dev)
- icanhazstring/composer-unused: >=0.8.1
- phpstan/phpstan: >=1.4
- phpunit/phpunit: >=9.5
- symfony/browser-kit: 6.2.*
- symfony/css-selector: 6.2.*
- symfony/debug-bundle: 6.2.*
- symfony/maker-bundle: >=1.0
- symfony/phpunit-bridge: >=5.4
- symfony/stopwatch: 6.2.*
- symfony/web-profiler-bundle: 6.2.*
- symfony/webpack-encore-bundle: >=1.13
This package is auto-updated.
Last update: 2024-11-16 00:05:47 UTC
README
Description
Kazetenn Pages is a symfony bundle that allow you to handle basic pages programatically.
Installation
You can use
composer require elvandar/kazetennpages
to install the bundle.
you will also need to configure stof/doctrineextensionsbundle
:
in config/packages/stof_doctrine_extensions.yaml
stof_doctrine_extensions: orm: your_orm: timestampable: true
Usage
The bundle provides a simple data model to handle the programatical creation of pages and some routes and views to display those pages.
configuration:
To use the routes provided by the bundle, you will have to add the following line to config/routes.yaml
:
kazetenn_pages: resource: "@KazetennPages/Resources/config/routes.yaml"
in config/packages/kazetenn-pages.yaml
:
kazetenn_pages: blog_url: ""
by default there is no prefix in front the diplay route, however, using this config you can add one.
the data model
the budle articulates around 2 entities:
Page
which represent a page to display
in a page, you can define:
- a title
- a slug
- a parent
- a list of content
this will be used to handle the page display and url
if the page have no parent, her url will be:
/{blog_url}/{slug}
if the page have a parent, her url will be:
/{blog_url}/{parent_slug}/{slug}
PageContent
which handle the content of a page.
in a pageContent, you will can define:
- a content
- a template
- a parent
- an order
- a align (vertical or horizontal)
- a list of content
The content is a text/html. It will always be rendered using the raw
twig function.
The template allows you to define a twig template to personalize the rendering of the content without storing html in the database.
A pageContent can reference multiple other pageContent (childs). Using the align property, you can define the way a content's childs will be rendered. Using this, you can easilly create a grid of content, allowing you to easily order you content. To ease this, a pageContent's content property can be null, allowing you to create an ordering pageContent.
Finally, the order property allow you to choose the rendering order of a pageContent between him and same level contents.
License
The pages bundle is under MIT liscence