ctrlwebinc/voyager-modals

Arrrrr! A package to implement modals into Voyager Pages and Voyager Page Blocks

0.0.21 2020-07-22 16:45 UTC

README

Latest Version on Packagist Total Downloads Build Status StyleCI

This is where your description should go. Take a look at contributing.md to see a to do list.

Prerequisites

Installation

Via Composer

  1. Require this package in your project
composer require ctrlwebinc/voyager-modals
  1. Run the install command
php artisan voyager-modals:install
  1. Add the following block to your project's config/page-blocks.php file
$blocks['block-modal'] = [
    'name' => 'Modal CTA',
    'template' => 'voyager-modals::modal-cta',
    'fields' => [
        'cta_text' => [
            'field' => 'cta_text',
            'display_name' => 'CTA Text',
            'partial' => 'voyager::formfields.text',
            'required' => 0,
        ],
        'modal' => [
            'field' => 'modal',
            'display_name' => 'Modal',
            'partial' => 'voyager-modals::formfields.modal-selector',
            'required' => 1,
        ],
    ],
];

Usage

Create a modal

Log in to your voyager admin and go to Modals. Click on Add New and fill the form. You can then use the Block Content action to create the modal's body.

Adding a modal to your page

Go to your page's block contents and add the Modal CTA block. Enter a title and chose your modal.

Change log

Please see the changelog for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email info@ctrlweb.ca instead of using the issue tracker.

Credits

License

MIT. Please see the license file for more information.

Remerciements (yeah, we're French-speakers)

Merci au Théâtre du Nouveau Monde, et à Olivier Chassé en particulier, pour son soutien dans le développement initial de ce projet.