2017 © Pedro Peláez
 

yii2-extension yii2-shortcodes-pack

Shortcodes collection as WP for Yii2

image

loveorigami/yii2-shortcodes-pack

Shortcodes collection as WP for Yii2

  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 6 Open issues
  • 5 Versions
  • 13 % Grown

The README.md

Yii2-shortcodes-pack

Latest Stable Version Total Downloads License, (*1)

Yii2-shortcodes-pack is part of the Yii2-plugins-system that have more usefull shortcodes for our site, (*2)

"Shortcodes", (*3)

0. Shortcodes in pack

Shortcode Description Usage Code
yt YouTube link on original video [yt code="*"] Link on video [/yt] see
youtube Embed YouTube video with parameters [youtube code="" w="" h="*"] see
code All the blocks of text enclosed in the shortcode [code], will be highlighted [code style="" lang=""] ... [/code] see
container Bootstrap 3 grid - container (default or fluid) [container] ... [/container] see
row Bootstrap 3 grid - row [row] ... [/row] see
col Bootstrap 3 grid - column (lg, md, sm, xs) [col md=6] ... [/col] see
alert Bootstrap 3 alert messages [alert close=1] ... [/alert] see
label Bootstrap 3 labels [label text="*"] see
tabs Bootstrap 3 tabs or pills [tabs] [tab] ... [/tab] [/tabs] see

and more in future releases..., (*4)

How create my shortcode?


1. Download

Yii2-shortcodes-pack be installed using composer. Run following command to download and install Yii2-shortcodes-pack:, (*5)

composer require "loveorigami/yii2-shortcodes-pack":"*"

2. Update database schema

The last thing you need to do is updating your database schema by applying the migrations. Make sure that you have properly configured db application component and run the following command:, (*6)

$ php yii migrate/up --migrationPath=@vendor/loveorigami/yii2-plugins-system/migrations

3. Configure application

Let's start with defining module in @backend/config/main.php:, (*7)

'modules' => [
    'plugins' => [
        'class' => 'lo\plugins\Module',
        'pluginsDir'=>[
            '@lo/plugins/core', // default dir with core plugins
            '@lo/shortcodes' // dir with shortcodes pack
            '@common/shortcodes', // dir with our plugins with shortcodes
        ]
    ],
],

That's all, now you have module installed and configured in advanced template., (*8)

Next, open @frontend/config/main.php and add following:, (*9)

...
'components' => [
    'plugins' => [
        'class' => lo\plugins\components\PluginsManager::class,
        'appId' => 1 // lo\plugins\BasePlugin::APP_FRONTEND,
        // by default
        'enablePlugins' => true,
        'shortcodesParse' => true,
        'shortcodesIgnoreBlocks' => [
            '<pre[^>]*>' => '<\/pre>',
            //'<div class="content[^>]*>' => '<\/div>',
        ]
    ],
    'view' => [
        'class' => lo\plugins\components\View::class,
    ]
    ...
]

Also do the same thing with @backend/config/main.php:, (*10)

...
'components' => [
    'plugins' => [
        'class' => lo\plugins\components\PluginsManager::class,
        'appId' => 2 // lo\plugins\BasePlugin::APP_BACKEND
    ],
    'view' => [
        'class' => lo\plugins\components\View::class,
    ]
    ...
]

The Versions

03/02 2018

dev-master

9999999-dev

Shortcodes collection as WP for Yii2

  Sources   Download

MIT

The Requires

 

plugin yii2 shortcode

14/09 2017

1.3

1.3.0.0

Shortcodes collection as WP for Yii2

  Sources   Download

MIT

The Requires

 

plugin yii2 shortcode

12/09 2017

1.2

1.2.0.0

Shortcodes collection as WP for Yii2

  Sources   Download

MIT

The Requires

 

plugin yii2 shortcode

19/01 2017

1.1

1.1.0.0

Shortcodes collection as WP for Yii2

  Sources   Download

MIT

The Requires

 

plugin yii2 shortcode

12/01 2017

1.0

1.0.0.0

Shortcodes collection as WP for Yii2

  Sources   Download

MIT

The Requires

 

plugin yii2 shortcode