floor12/yii2-single-content

1.0.0 2024-02-06 23:04 UTC

This package is auto-updated.

Last update: 2024-04-06 23:32:28 UTC


README

Yii2 Single Content Editor

This is a simple content editor for Yii2. It allows you to create a lot of single content blocks for landing page or template parts and then edit it using textarea.

Installation

The preferred way to install this extension is through composer.

Add module to your project:

composer require floor12/yii2-single-content

Add module to your config file:

'modules' => [
      'single_content' => [
        'class' => 'floor12\single_content\Module',
        'administratorRoleName' => '@',
    ],
],

Usage

Then add a widget to your view file:

    echo SingleContentItemWidget::widget(['id' => 'example-landing-block-001']);
    echo SingleContentItemWidget::widget(['id' => 'one-more-block']);

If you are logged in as an administrator, you can click on the block and edit it using a textarea in the modal window.