selenesoftware / cms-bundle
CMS platform for Symfony
Installs: 216
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 3
Forks: 0
Open Issues: 6
Type:symfony-bundle
Requires
- php: ^8.1|^8.2
- doctrine/doctrine-bundle: ^2.12
- doctrine/orm: ^3.2
- easycorp/easyadmin-bundle: ^4.4
- eckinox/tinymce-bundle: ^1.1
- league/commonmark: ^2.3
- presta/sitemap-bundle: ^4.0
- symfony/expression-language: ^6.4|^7.0|^7.1
- symfony/form: ^6.4|^7.0|^7.1
- symfony/mailer: ^6.4|^7.0|^7.1
- symfony/mime: ^6.3|^6.4|^7.0|^7.1
- symfony/orm-pack: ^2.3
- symfony/security-bundle: ^6.4|^7.0|^7.1
- symfony/security-csrf: ^6.4|^7.0|^7.1
- symfony/ux-toggle-password: ^2.18
- symfony/ux-turbo: ^2.18
- symfony/ux-twig-component: ^2.18
- symfonycasts/reset-password-bundle: ^1.22
- twig/extra-bundle: ^3.4
- twig/markdown-extra: ^3.4
- twig/twig: ^2.12|^3.0
This package is auto-updated.
Last update: 2024-11-18 20:06:00 UTC
README
This is a bundle for the Symfony Web Framework. As such, installing requires a few needed steps. First, have an updated version of the Composer Package Manager installed on your system.
Installation
This bundle enables CMS functionality on a Symfony site. This requires a few instalation steps, hopefully the Symfony Flex took care of them, but here are the steps.
If you are using Symfony Flex, as you should be, just run this composer command in your project:
bash composer require selenesoftware/cms-bundle
The Recipe will install the necessary Controllers and configurations so that you can just get started.
If you aren't using Flex, you will need to add the following line:
// app/AppKernel.php class AppKernel extends Kernel { public function registerBundles() { $bundles = [ // ... new Selene\CMSBundle\seleneCMSBundle(), ]; // ... } }
Then you will need several controllers that extend the controllers in the bundle:
BlogController extends Selene\CMSBundle\Controller\BlogController SecurityController extends Selene\CMSBundle\Controller\SecurityController RegistrationController extends Selene\CMSBundle\Controller\RegistrationController AdminDashboardController extends Selene\CMSBundle\Controller\Admin\DashboardController
You will need to create a few templates for your new site.
templates/blog/index.html.twig templates/security/login.html.twig templates/registration/register.html.twig templates/confirmation_email.html.twig
Once the bundle is installed, run whatever you need for your database.
This will install the following routes in your application: /blog /blog/{entry} /register /login /admin
Usage
Content is managed in the backend when a Twig extension is used. The name of the block will appear in the admin panel on first load and give the ability to change the data inside the tag. To create a content block with the title "selene", use the following tag.
Images also have a content block. If an image has been uploaded in the sytem, a slug is generated that will load the url of that image. If the image hasn't been uploaded yet, the url given will be used as a default.
{% apply selene_content %}<div class="block">This is the default content in the block</div>{% endapply%} <img srg="{% apply name_image %}image/url.jpg"{% endapply %}
This also installs settings, which are true/false or on/off. To use one of those, use the following tag:
{% if getSetting('Search') %}<div class="search"><input type="text"></div>{% endif %}
Settings by default are false, so the first time that is loaded on the site, the stuff in between will not show.
The wonderful thing about content and setting tags is the default setting. You don't have to create them in the admin panel to create one. Just program it in your Twig template and it will appear on your admin panel the first time it is rendered. From there, you can change them however you want. And if you need to use the same content in different places, you can do just that.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.