2017 © Pedro PelĂĄez
 

yii2-extension yii2-simple-cms

a basic yii2 content management extension for easily creating and maintaining a page structure for frontend use

image

schallschlucker/yii2-simple-cms

a basic yii2 content management extension for easily creating and maintaining a page structure for frontend use

  • Thursday, March 1, 2018
  • by paul_k
  • Repository
  • 12 Watchers
  • 44 Stars
  • 1,265 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 25 Forks
  • 2 Open issues
  • 17 Versions
  • 3 % Grown

The README.md

Yii2-simple-cms

A basic yii2 content management module for easily creating and maintaining a page structure, including navigation widget, full text search, image and document management and a wysiwyg html editor for the content pages. Does not include an fine granulated access rights management, only differentiates between: anonymous/guest and logged in users. The extensions supports site structures in multiple languages for international sites., (*1)

NOTE: Module is in initial development. Anything may change at any time., (*2)

Documentation

Yii2-simple-cms documentation is available online:, (*3)

See Project page for source code and Project wiki for more details, screenshots etc., (*4)

Installation instructions are located in the installation guide, (*5)

Prefered way is using composer by adding the reuquirement to your composer.json and running composer update afterwards:, (*6)

"require": {
    "schallschlucker/yii2-simple-cms": ">=0.2.4",
}

After installation run migration for database table creation (it is assumed at this point, that the yii2 db module is configured properly in your configuration). Currently the scripts support only mysql databases, other databases might work as well but haven't been tested yet and thus are disabled in the migration script):, (*7)

yii migrate --migrationPath=@schallschlucker/simplecms/migrations

Finally create a folder where to store the uploaded images from the WYSIWYG editor. To do so, create a subfolder named "mediarepository" in the web folder of you application. If you use separated applications for backend and frontend, simply create a simlink to the sceond web folder to use the mediarepository there as well. Then set the access rights to this folder accordingly so that php is allowed to write to this folder., (*8)

It is also possible to place the mediarepository outside of the web folder to limit access to uploaded files, but then each file needs to be read by php and delivered to the client which certainly has an impact on the performance, so this should only be used if the media data is somewhat sensitive and should only be availbale to logged in users. when the folder is not placed in the web folder, the module configuration needs to be changed (at the moment you need to edit the backend.php and frontend.php file in the vendor folder of simple-cms, in future versions we will document how to overwrite the path in the module configuration), (*9)

Usage

the extension is split into two modules: the frontend and the backend module., (*10)

Frontend provides the needed controllers to: - display page content - display documents - display a search form and a search result page Widgets to: - render a navigation menu (extending yii\bootstrap\Nav widget) - render the navigation structure in different formats like a html list (ol or ul and li nodes), xml, json - render the search bar - render extended search form - render the search results list, (*11)

The backend provides administrative functions for maintaining the page tree structure (including drag and drop functionality, keyboard shortcuts and context menus for easy creation of new pages)., (*12)

Both modules can be deployed in the same application, but it is recommended to follow the frontend/backend approach to clearly separate the frontend (user view) from the administrative backend interface., (*13)

Content pages in simple cms can be created in multiple language, since simple cms uses internal language id's which might differ from your applications language codes (i.e. ISO 2 letter code or 5 letter code) you need ti initalize the LanguageManager in the components section with a valid mapping to map you applications language codes to the simple cms language codes. Here is an example (which also uses aliases to e.g. map the application language code "de-DE" to the simple cms language code "1" etc.). You can add support for additional languages in simple cms just by adding new mappings.:, (*14)

'components' => [
    'simplecmsLanguageManager' => [
        'class' => 'schallschlucker\simplecms\LanguageManager',
        'languageIdMappings' => [
            '1' => [
                'id' => 1,
                    'code' => 'de_DE', 
                    'displaytext' => [
                        'de_DE' => 'deutsch', 
                        'en_US' => 'german',
                        'pl_PL' => 'niemiecki',
                        'tr_TR' => 'alman',
                    ],
                ],
                'de_DE' => [
                    'alias' => '1'
                ],
                'de-DE' => [
                    'alias' => '1'
                ],
                '2' => [
                    'id' => 2,
                    'code' => 'en_US', 
                    'displaytext' => [
                        'de_DE' => 'englisch', 
                        'en_US' => 'english',
                        'pl_PL' => 'angielski',
                        'tr_TR' => 'ingilizce',
                    ],
                ],
                'en_US' => [
                    'alias' => '2',
                ],
                'en-US' => [
                    'alias' => '2',
                ],
                '3' => [
                    'id' => 3,
                    'code' => 'pl_PL', 
                    'displaytext' => [
                        'de_DE' => 'polnisch', 
                        'en_US' => 'polish',
                        'pl_PL' => 'polski',
                        'tr_TR' => 'lehçe',
                    ],
                ],
                '4' => [
                    'id' => 4,
                    'code' => 'tr_TR', 
                    'displaytext' => [
                        'de_DE' => 'tĂŒrkisch', 
                        'en_US' => 'turkish',
                        'pl_PL' => 'turecki',
                        'tr_TR' => 'tĂŒrk',
                    ],
                ],
        ],
],
'modules' => [
    'simplecms_backend' => [
        'class' => 'schallschlucker\simplecms\Backend',
        'languageManager' => 'simplecmsLanguageManager',
        'cache' => 'cache',
        ],
    'simplecms_frontend' => [
        'urlPrefix' => 'cms', //the context alias for the module if you do not want to use simplecms_frotend in your URLs to call the pretty URL aliases
        'class' => 'schallschlucker\simplecms\Frontend',
        'languageManager' => simplecmsLanguageManager,
        'renderTopMenuNavbar' => true, //boolean to indicate if a bootstrap navbar dropdown navigation (using CmsBootstrapNavbarWidget) should be rendered by the view. Set to false of you build your own navigation using one of the widgets provided by simplecms (e.g. CmsBootstrapNavbarWidget or CmsSitemapWidget)  (optional, default is true)
        'htmlTitlePrefix' => '', //string to prepend to html title tag (optional, default is empty)
        'htmlTitleSuffix' => '', //string to append to generated html title tag (optional, default is empt)
        'cache' => 'cache' //NOTE: remove this line if you do not have a cache component configured. Caching will reduce the load on the server a lot when building page trees, so it is highly recommended to user a proper cache implementation like memcached etc.
    ],
    'media_manager' => [
        'class' => 'schallschlucker\simplecms\MediaManager',
        'mediarepositoryPath' => '/var/www/virtualhosts/www.einzelpflegefachkraft.de/curassist-app/mediarepository/',
    ],
],

After the modules are registered, you should be able to open the administration backend by calling the "simplecms_backend" route e.g. by calling:, (*15)

http://yourserver/index.php?r=simplecms_backend, (*16)

or if pretty URLs are activated:, (*17)

http://yourserver/simplecms_backend, (*18)

Then you should see the Simple CMS Administration Backend with a root node in the page-tree. By right-clicking on the root node you can add new pages to the page tree. Each page has multiple language versions, so you can create common page tree structure for all different language versions. Via drag and drop you can rearange the positions of the pages within the page tree. Each page (except for the root node) can be set to one of three states: - visible: it will show up in the rendered navigation by the navigation widget - hidden: the page won't be shown in the navigation, yet it can be linked of found in the search - unpublished: the page will neither be shown in the navigation nor in the search results and cannot be linked, (*19)

Each page can have three different behavious/types: - content page: the page is a normal content whose content can be edited via the embeded WYSIWYG editor - linked document: the page is basically a link to a uploaded document (e.g. PDF) that will be rendered as a link in the navigation - URL: the page will directly link to any given URL. This can be used to create an alias of a page in the navigation or to link to an external URL and embedding this link in the normal navigation, (*20)

You can select one of these page types when creating a new page language version., (*21)

Please note:

In order for the page administration to work you need to be logged in, otherwise an error will occur since the user id will be stored for auditing purposes upon page creation or modification., (*22)

License

yii2-simple-cms is released under the Apache License 2.0. See the bundled LICENSE.md for details., (*23)

The Versions

01/03 2018

dev-master

9999999-dev https://github.com/pkerspe/yii2-simple-cms/wiki

a basic yii2 content management extension for easily creating and maintaining a page structure for frontend use

  Sources   Download

Apache-2.0 Apache 2.0

The Requires

 

yii2 wysiwyg content management yii2-cms pagetree schallschlucker

01/03 2018

0.3.2

0.3.2.0 https://github.com/pkerspe/yii2-simple-cms/wiki

a basic yii2 content management extension for easily creating and maintaining a page structure for frontend use

  Sources   Download

Apache-2.0

The Requires

 

yii2 wysiwyg content management yii2-cms pagetree schallschlucker

09/04 2017

0.3.1

0.3.1.0 https://github.com/pkerspe/yii2-simple-cms/wiki

a basic yii2 content management extension for easily creating and maintaining a page structure for frontend use

  Sources   Download

Apache 2.0

The Requires

 

yii2 wysiwyg content management yii2-cms pagetree schallschlucker

05/04 2017

0.3

0.3.0.0 https://github.com/pkerspe/yii2-simple-cms/wiki

a basic yii2 content management extension for easily creating and maintaining a page structure for frontend use

  Sources   Download

Apache 2.0

The Requires

 

yii2 wysiwyg content management yii2-cms pagetree schallschlucker

05/04 2017

dev-teaser-image-and-text

dev-teaser-image-and-text https://github.com/pkerspe/yii2-simple-cms/wiki

a basic yii2 content management extension for easily creating and maintaining a page structure for frontend use

  Sources   Download

Apache 2.0

The Requires

 

yii2 wysiwyg content management yii2-cms pagetree schallschlucker

19/03 2017

dev-ckeditor-462

dev-ckeditor-462 https://github.com/pkerspe/yii2-simple-cms/wiki

a basic yii2 content management extension for easily creating and maintaining a page structure for frontend use

  Sources   Download

Apache 2.0

The Requires

 

yii2 wysiwyg content management yii2-cms pagetree schallschlucker

01/05 2016

0.2.4.3

0.2.4.3 https://github.com/pkerspe/yii2-simple-cms/wiki

a basic yii2 content management extension for easily creating and maintaining a page structure for frontend use

  Sources   Download

Apache 2.0

The Requires

 

yii2 wysiwyg content management yii2-cms pagetree schallschlucker

03/12 2015

dev-pr/4

dev-pr/4 https://github.com/pkerspe/yii2-simple-cms/wiki

a basic yii2 content managment extension for easily creating and maintaining a page structure for frontend use

  Sources   Download

Apache 2.0

The Requires

 

yii2 content management yii2-cms pagetree schallschlucker

04/07 2015

0.2.4.2

0.2.4.2 https://github.com/pkerspe/yii2-simple-cms/wiki

a basic yii2 content managment extension for easily creating and maintaining a page structure for frontend use

  Sources   Download

Apache 2.0

The Requires

 

yii2 content management yii2-cms pagetree schallschlucker

04/07 2015

0.2.4.1

0.2.4.1 https://github.com/pkerspe/yii2-simple-cms/wiki

a basic yii2 content managment extension for easily creating and maintaining a page structure for frontend use

  Sources   Download

Apache 2.0

The Requires

 

yii2 content management yii2-cms pagetree schallschlucker

15/03 2015

0.2.4

0.2.4.0 https://github.com/pkerspe/yii2-simple-cms/wiki

a basic yii2 content managment extension for easily creating and maintaining a page structure for frontend use

  Sources   Download

Apache 2.0

The Requires

 

yii2 content management yii2-cms pagetree schallschlucker

12/01 2015

0.2.3

0.2.3.0 https://github.com/pkerspe/yii2-simple-cms/wiki

a basic yii2 content managment extension for easily creating and maintaining a page structure for frontend use

  Sources   Download

Apache 2.0

The Requires

  • php >=5.5.0

 

yii2 content management yii2-cms pagetree schallschlucker

11/01 2015

0.2.2

0.2.2.0 https://github.com/pkerspe/yii2-simple-cms/wiki

a basic yii2 content managment extension for easily creating and maintaining a page structure for frontend use

  Sources   Download

Apache 2.0

The Requires

  • php >=5.5.0

 

yii2 content management yii2-cms pagetree schallschlucker

18/12 2014

0.2.1

0.2.1.0 https://github.com/pkerspe/yii2-simple-cms/wiki

a basic yii2 content managment extension for easily creating and maintaining a page structure for frontend use

  Sources   Download

Apache 2.0

The Requires

  • php >=5.5.0

 

yii2 content management yii2-cms pagetree schallschlucker

17/12 2014

0.2

0.2.0.0 https://github.com/pkerspe/yii2-simple-cms/wiki

a basic yii2 content managment extension for easily creating and maintaining a page structure for frontend use

  Sources   Download

Apache 2.0

The Requires

  • php >=5.5.0

 

yii2 content management yii2-cms pagetree schallschlucker

17/12 2014

0.1.1

0.1.1.0 https://github.com/pkerspe/yii2-simple-cms/wiki

a basic yii2 content managment extension for easily creating and maintaining a page structure for frontend use

  Sources   Download

Apache 2.0

The Requires

  • php >=5.5.0

 

yii2 content management yii2-cms pagetree schallschlucker

17/12 2014

0.1

0.1.0.0 https://github.com/pkerspe/yii2-simple-cms/wiki

a basic yii2 content managment extension for easily creating and maintaining a page structure for frontend use

  Sources   Download

Apache 2.0

The Requires

 

yii2 content management yii2-cms pagetree schallschlucker