All Projects → yii2mod → Yii2 Cms

yii2mod / Yii2 Cms

Licence: mit
Simple CMS extension

Projects that are alternatives of or similar to Yii2 Cms

Yii2 Slack Log
Pretty Slack log target for Yii 2
Stars: ✭ 24 (-42.86%)
Mutual labels:  yii2, yii2-extension
Yii2 Gentelella
Free admin template for backend
Stars: ✭ 266 (+533.33%)
Mutual labels:  yii2, yii2-extension
collection
Basic collection library for Yii Framework 2.0
Stars: ✭ 29 (-30.95%)
Mutual labels:  yii2, yii2-extension
yii2-blog
Simple, configurable blog module for Yii2 (post, comment, nested category, tags). + frontend, backend. + SEO! (Opengraph, Schema.org) ~~~COMING SOON V2.0~~~ Please STAR this repo
Stars: ✭ 79 (+88.1%)
Mutual labels:  yii2, yii2-extension
Yii2 Bx Slider
bx-slider.js wrapper for yii2.
Stars: ✭ 11 (-73.81%)
Mutual labels:  yii2, yii2-extension
Yii2 Image Attachment
This extension intended to handle images associated with model.
Stars: ✭ 35 (-16.67%)
Mutual labels:  yii2, yii2-extension
Yii2 Telegram Log
Telegram log target for Yii 2
Stars: ✭ 24 (-42.86%)
Mutual labels:  yii2, yii2-extension
yii2-facades
Facades for Yii 2
Stars: ✭ 21 (-50%)
Mutual labels:  yii2, yii2-extension
Yii2 Many To Many
Implementation of Many-to-many relationship for Yii 2 framework
Stars: ✭ 30 (-28.57%)
Mutual labels:  yii2, yii2-extension
Yii2 Google Maps Markers
Google Maps Markers Widget for Yii2
Stars: ✭ 16 (-61.9%)
Mutual labels:  yii2, yii2-extension
Yii2 C3 Chart
Yii2 wrapper for D3-based reusable chart library
Stars: ✭ 9 (-78.57%)
Mutual labels:  yii2, yii2-extension
Yii2 Elfinder
elFinder file manager for Yii 2
Stars: ✭ 21 (-50%)
Mutual labels:  yii2, yii2-extension
yii2-jwt-user
JWT (JSON Web Token) User component for Yii 2
Stars: ✭ 16 (-61.9%)
Mutual labels:  yii2, yii2-extension
Yii2 User
[ABANDONED] Flexible user registration and authentication module for Yii2
Stars: ✭ 946 (+2152.38%)
Mutual labels:  yii2, yii2-extension
yii2-firebird
Firebird connector for Yii2 framework
Stars: ✭ 23 (-45.24%)
Mutual labels:  yii2, yii2-extension
yii2-queuemanager
Yii2 Queue Manager (Analytic & Monitor)
Stars: ✭ 18 (-57.14%)
Mutual labels:  yii2, yii2-extension
yii2-telegram
Support chat for site based on Telegram bot
Stars: ✭ 49 (+16.67%)
Mutual labels:  yii2, yii2-extension
yii2-star-rating
Star rating widget based on jQuery Raty
Stars: ✭ 16 (-61.9%)
Mutual labels:  yii2, yii2-extension
Yii2 Helpers
Collection of useful helper functions for Yii Framework 2.0
Stars: ✭ 16 (-61.9%)
Mutual labels:  yii2, yii2-extension
Yii2 Selectize
selectize.js wrapper for yii2.
Stars: ✭ 18 (-57.14%)
Mutual labels:  yii2, yii2-extension

Yii2 CMS Extension


This module provides a web interface for content management system and includes the following features:

Latest Stable Version Total Downloads License Build Status

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist yii2mod/yii2-cms "*"

or add

"yii2mod/yii2-cms": "*"

to the require section of your composer.json.

CONFIGURATION

Database Migrations

Before usage this extension, we'll also need to prepare the database.

$ php yii migrate --migrationPath=@vendor/yii2mod/yii2-comments/migrations
$ php yii migrate --migrationPath=@vendor/yii2mod/yii2-cms/migrations

Module Setup

To access the module, you need to configure the modules array in your application configuration:

'modules' => [
    'cms' => [
        'class' => 'yii2mod\cms\Module',
    ],
],

You can then access to management section through the following URL:

http://localhost/path/to/index.php?r=/cms/manage/index

Configure Url Manager

You need to configure the urlManager array in your application configuration:

 'components' => [
     'urlManager' => [
         'rules' => [
             ['class' => 'yii2mod\cms\components\PageUrlRule'],
         ]
     ],
 ],

Setup Page Action

Add to SiteController (or configure via $route param in urlManager):

public function actions()
{
    return [
        'page' => [
            'class' => 'yii2mod\cms\actions\PageAction',
        ]
    ];
}

Now you can use this module with all available features.

Features:

  1. By default this extension uses the froala editor for manage cms pages, you can change editor configuration by the following code:

List of options: https://www.froala.com/wysiwyg-editor/docs/options

Configuration example: https://github.com/froala/yii2-froala-editor#usage

'modules' => [
    'cms' => [
        'class' => 'yii2mod\cms\Module',
        'froalaEditorOptions' => [
            // your custom configuration
            'clientPlugins' => [
            ],
            'clientOptions' => [
            ],
            'excludedPlugins' => [
            ],
        ],
    ],
],
  1. Markdown Editor support:
'modules' => [
    'cms' => [
        'class' => 'yii2mod\cms\Module',
        'enableMarkdown' => true,
        // List of options: https://github.com/NextStepWebs/simplemde-markdown-editor#configuration
        'markdownEditorOptions' => [
            'showIcons' => ['code', 'table'],
        ],
    ],
],
  1. You can insert your own widget on the page by the following steps:
  • Create the widget, for example:
namespace app\widgets;

use yii\base\Widget;

class MyWidget extends Widget
{
   /**
    * @inheritdoc
    */
   public function run()
   {
       parent::run();

       echo 'Text from widget';
   }

   /**
    * This function used for render the widget
    *
    * @return string
    */
   public static function show()
   {
       return self::widget();
   }
}
  • When you create the page via admin panel add the following code to the page content:
 [[\app\widgets\MyWidget:show]]
  1. You can use parameters in your page content, for example: {siteName}, {homeUrl}. For parsing this parameters you can use the baseTemplateParams property:
public function actions()
{
    return [
        'page' => [
            'class' => 'yii2mod\cms\actions\PageAction',
            'baseTemplateParams' => [
               'homeUrl' => 'your site home url',
               'siteName' => Yii::$app->name
            ]
        ],
    ];
}
  1. You can change comments module settings by the following code:
public function actions()
{
    return [
        'page' => [
            'class' => 'yii2mod\cms\actions\PageAction',
            'commentWidgetParams' => [
                'maxLevel' => 1,
                'dataProviderConfig' => [
                    'pagination' => [
                        'pageSize' => 10
                    ],
                ],
            ]
        ]
    ];
}

For detail information about comments module please visit the following page

Support us

Does your business depend on our contributions? Reach out and support us on Patreon. All pledges will be dedicated to allocating workforce on maintenance and new awesome stuff.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].