2017 © Pedro Peláez
 

yii2-extension yii2-publication-module

A module for publications

image

dmstr/yii2-publication-module

A module for publications

  • Monday, July 23, 2018
  • by schmunk
  • Repository
  • 4 Watchers
  • 1 Stars
  • 690 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 16 Versions
  • 369 % Grown

The README.md

Yii2 Publication Module

A module for publications, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist dmstr/yii2-publication-module "*"

or add, (*4)

"dmstr/yii2-publication-module": "*"

to the require section and, (*5)

{
    "type": "vcs",
    "url": "https://git.hrzg.de/dmstr/yii2-publication-module.git"
}

to the repositories section of your composer.json file., (*6)

Configuration

Once the extension is installed, simply use it in your code by adding the two module to the module section of your config, (*7)

'modules' => [
    'publication' => [
        'class' => dmstr\modules\publication\Module::class,
        'previewItemRole' => null // This describes a rbac role which allowed the user which has grants for this privilege to access the default detail action even if the item is not published
    ]
]

Run migrations from @dmstr/modules/publication/migrations., (*8)

Usage

Create widget-templates /widgets/crud/widget-template/index for teaser, (*9)

{
    "title": "News Teaser",
    "type": "object",
    "properties": {
        "teaser": {
            "type": "string",
            "title": "Teaser",
            "default": "subline"
        }
    }
}

and content., (*10)

{
    "title": "News Content",
    "type": "object",
    "properties": {
        "content": {
            "type": "string",
            "title": "Content",
            "default": "Content"
        }
    }
}

Create a category, ie. News and assign templates to it., (*11)

Create an item., (*12)


publication/default/index?categoryId=1, (*13)

Use variables from content schema in teaser template

{{ content.headline }}
{{ content.image }}

The Versions