Manage and expose web fonts with Roadiz CMS
Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.
Open a command console, enter your project directory and execute:
$ composer require roadiz/font-bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
$ composer require roadiz/font-bundle
Then, enable the bundle by adding it to the list of registered bundles
in the config/bundles.php
file of your project:
// config/bundles.php
return [
// ...
\RZ\Roadiz\FontBundle\RoadizFontBundle::class => ['all' => true],
];
- Create folders:
var/files/fonts
for fonts storage - Add Flysystem storage definition
# config/packages/flysystem.yaml
flysystem:
storages:
font.storage:
adapter: 'local'
options:
directory: '%kernel.project_dir%/var/files/fonts'
- Copy and merge
@RoadizFontBundle/config/packages/*
files into your projectconfig/packages
folder
# config/routes.yaml
roadiz_font:
resource: "@RoadizFontBundle/config/routing.yaml"
- Add bundle to doctrine entity mapping
doctrine:
orm:
mappings:
RoadizFontBundle:
is_bundle: true
type: attribute
dir: 'src/Entity'
prefix: 'RZ\Roadiz\FontBundle\Entity'
alias: RoadizFontBundle
- Create a new Roadiz role:
ROLE_ACCESS_FONTS
- Add new
roadiz_rozier
admin sub-entry
---
roadiz_rozier:
entries:
construction:
subentries:
manage_fonts:
name: 'manage.fonts'
route: fontsHomePage
icon: 'uk-icon-rz-fontes'
roles: ['ROLE_ACCESS_FONTS']
- Perform Doctrine Migrations to create
fonts
table
Report issues and send Pull Requests in the main Roadiz repository