Download the PHP package orbitale/cms-bundle without Composer

On this page you can find all versions of the php package orbitale/cms-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cms-bundle

SensioLabsInsight Coverage Status Build Status Scrutinizer Code Quality

:warning: You're looking at the 4.x branch documentation.
If you need information about 3.x, go here If you need information about 2.x, go here If you need information about 1.x, go here

Index

Orbitale CMS Bundle

This bundle is a simple helper to create a very simple CMS based on a classic system with Pages and Categories.

Requirements

Install

Require the bundle by using Composer:

Setup

Register the necessary bundles in your Kernel:

Import the necessary routing files.

Warning: Both Page and Category controllers have to be "alone" in their routing path, because there is a "tree" routing management. If you set the prefix as "/" or any other path you are already using, make sure that OrbitaleCmsBundle routes are loaded at the end of your routing file, or you may have some unexpected "404" or other errors, depending on the routes priority.
This is why we recommend you to load the CategoryController before the PageController, and let both routes config be the last ones of your routing.yml file.
Note: In technical terms, the whole URI is scanned, not a simple part of it, this is why it can analyze very deep URIs like /home/blog/parent-link/child-link/element, and check all pages/categories.

Example:

Create your entities

This bundle supports Doctrine ORM only.

In order to use it, you must create your own entities and configure the bundle with them.

Update your config:

Create the Page entity and add it to your config

Create the Category entity and add it to your config

Update your db schema

Update your database by executing this command from your Symfony root directory:

Usage

Manage pages

To manage your pages, you should use any back-end solution, like EasyAdmin (which we suggest) or SonataAdmin, or any other backend solution that can operate CRUD actions on entities. You must have configured it to manage at least the Orbitale\Bundle\CmsBundle\Entity\Page entity.

View pages

The PageController handles some methods to view pages with a single indexAction(), and the CategoryController uses its route to show all pages within a specified Category.

The URI for both is simply /{slug} where slug is the... page or category slug.

If your page or category has one parent, then the URI is the following: /{parentSlug}/{slug}.

You can notice that we respect the pages hierarchy in the generated url.

You can navigate through a complex list of pages or categories, as long as they are related as parent and child.

This allows you to have such urls like this one : http://www.mysite.com/about/company/team/members for instance, will show only the members page, but its parent has a parent, that has a parent, and so on, until you reach the "root" parent. And it's the same behavior for categories.

Note: this behavior is the precise reason why you have to use a specific rules for your routing, unless you may have many "404" errors.

Generate a route based on a single page

Note: This behavior also works for categories.

If you have a Page object in a view or in a controller, you can get the whole arborescence by using the getTree() method, which will navigate through all parents and return a string based on a separator argument (default /, for urls).

Let's get an example with this kind of tree:

Imagine we want to generate the url for the "Team" page. You have this Page object in your view/controller.

Or in a controller:

With this, you have a functional tree system for your CMS!

Change homepage

The homepage is always the first Page object with its homepage attribute set to true. Be sure to have only one element defined as homepage, or you may have unexpected results.

You can have multiple homepages if you add them restrictions based on host and locale (see next chapter).

Page restriction based host and/or locale

If you are hosting your application in a multi-domain platform, you can use the host attribute in your page to restrict the view only to the specified host.

It's great for example if you want to have different articles on different domains like blog.mydomain.com and www.mydomain.com.

If you want to restrict by locale, you can specify the locale in the page. The best conjointed use is with prefixed routes in the routing file:

Design

OrbitaleCmsBundle has some options to customize the design of your simple CMS.

Mostly, you will take care of the layouts option (see next chapter), or the design option.

Using different layouts

Obviously, the default layout has no style.

To change the layout, simply change the OrbitaleCmsBundle configuration to add your own layout:

Without overriding anything, you can easily change the layout for your CMS!

Take a look at the default layout to see which Twig blocks are mandatory to render correctly the pages.

Advanced layout configuration

The basic configuration for a layout is to specify a template to extend.

But if you look at the Configuration reference you will see that there are many other parameters you can use to define a layout:

Prototype of a layout configuration:

Take another look on the config reference if you need to get the prototype defaults.

:warning: Warning! The first matching layout will be used, as well as routing would do, so be sure to configure them in the right order!
Empty values won't be taken in account.

Changing the "breadcrumbs" look

Under the design option, you have some that you can use to optimize the rendering of the breadcrumbs.

Basically, it will look like this:

Parent page > Current page

Note: The breadcrumbs wrapper already has id="breadcrumbs" on its tag.

Cache

If you want to cache your cms results, just activate it via the config:

It uses Doctrine Result Cache so you need to activate it:

You can read more about DoctrineCache here.

Setup EasyAdminBundle to manage pages and categories in its back-end

This configuration allows you to manage your pages and categories directly in the EasyAdminBundle way.

First, install EasyAdminBundle, and set it up by reading its documentation (view link above).

After you installed it, you can add this configuration to inject your new classes in EasyAdmin:

Configuration reference

Changelog

Go to the releases page to see what are the changes between each new version of Orbitale CmsBundle!


All versions of cms-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3
doctrine/annotations Version ^1.8
doctrine/doctrine-bundle Version ^2.0
doctrine/orm Version ^2.5.1
symfony/asset Version ^5.3|^6.0
symfony/config Version ^5.3|^6.0
symfony/dependency-injection Version ^5.3|^6.0
symfony/framework-bundle Version ^5.3|^6.0
symfony/http-foundation Version ^5.3|^6.0
symfony/http-kernel Version ^5.3|^6.0
symfony/translation Version ^5.3|^6.0
symfony/twig-bundle Version ^5.3|^6.0
symfony/validator Version ^5.3|^6.0
twig/twig Version ^2.7|^3.0
symfony/string Version ^5.3|^6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package orbitale/cms-bundle contains the following files

Loading the files please wait ....