Skip to content

Commit

Permalink
merging
Browse files Browse the repository at this point in the history
  • Loading branch information
mnoskov committed Oct 17, 2017
2 parents a47b333 + 72a4190 commit f450494
Show file tree
Hide file tree
Showing 46 changed files with 964 additions and 566 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ Other languages: <a href="https://github.com/mnoskov/pagebuilder/blob/master/REA

[![Youtube review](https://i.ytimg.com/vi/yov7y-OXubo/hqdefault.jpg)](https://youtu.be/yov7y-OXubo)

Конфигурация для блоков берется из папки config. Для создания нового блока нужно создать в этой папке файл .php, который должен вернуть ассоциативный массив. Структура массива следующая:
Конфигурация для блоков берется из папки config. Для создания нового блока нужно создать в этой папке файл `.php`, который должен вернуть ассоциативный массив. Для создания контейнера нужно создать файл `.php`, имя которго будет начинаться с `container.`. Структура массива следующая:

<table>
<tr><th>Ключ</th><th>Значение</th></tr>
<tr><td>title</td><td>Название блока, видимое менеджеру при заполнении</td></tr>
<tr><td>container</td><td>Имя контейнера (если несколько - то массив имен), в котором будет выводится блок.</td></tr>
<tr>
<td>fields</td>
<td>
Expand All @@ -26,6 +27,7 @@ Other languages: <a href="https://github.com/mnoskov/pagebuilder/blob/master/REA
Если этот параметр указан, то "hide_in_docs" не принимается во внимание.

Если не указан ни один из параметров, ограничивающих доступ, блоки будут доступны во всех документах.</td></tr>
<tr><td>order</td><td>Порядок сортировки в секции добавления блока. Этот параметр НЕ влияет на сортировку самих блоков!</td></tr>
<tr>
<td>templates</td>
<td>
Expand Down Expand Up @@ -167,7 +169,9 @@ assets/templates/
<table>
<tr><th>Имя параметра</th><th>Значение по умолчанию</th><th>Возможные значения</th></tr>
<tr><td>docid</td><td>Текущий документ</td><td>Идентификатор любого существующего документа, целое число</td></tr>
<tr><td>container</td><td>default</td><td>Имя контейнера</td></tr>
<tr><td>blocks</td><td>*</td><td>Список блоков через запятую, без пробелов. Берется имя файла конфигурации без расширения (Например, 'all_fields,groups'). Если указать '*', фильтрация по имени произведена не будет</td></tr>
<tr><td>wrapTpl</td><td>[+wrap+]</td><td>Имя чанка, содержащего шаблон-обертку для списка блоков выводимого контейнера</td></tr>
<tr><td>templates</td><td></td><td>Идентификатор группы шаблонов, которые будут использоваться для вывода. Должен быть определен в конфигурации каждого выводимого блока</td></tr>
<tr><td>offset</td><td>0</td><td>Число пропускаемых блоков с начала вывода</td></tr>
<tr><td>limit</td><td>0</td><td>Число блоков для вывода, либо 0 - для вывода всех</td></tr>
Expand Down
53 changes: 53 additions & 0 deletions assets/plugins/pagebuilder/config/2col_photo_text.php.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php

return [
'title' => 'Two columns: image and text',

// 'show_in_templates' => [ 4 ],

// 'show_in_docs' => [ 2 ],

// 'hide_in_docs' => [ 5 ],

// 'order' => 1,

'image' => 'assets/plugins/pagebuilder/images/2col-photo-text.jpg',

// 'container' => 'default',

'templates' => [
'owner' => '
<div class="container">
<div class="row">
<div class="col-sm-6">
<img src="[[phpthumb? &input=`[+image+]` &options=`w=540,f=jpg`]]" alt="" class="img-fluid">
</div>

<div class="col-sm-6">
<div class="user-content">
[+richtext+]
</div>
</div>
</div>
</div>
',
],

'fields' => [
'image' => [
'caption' => 'Image',
'type' => 'image',
],

'richtext' => [
'caption' => 'Text',
'type' => 'richtext',
'default' => '',
'theme' => 'mini',
'options' => [
'height' => '200px',
],
],
],
];

53 changes: 53 additions & 0 deletions assets/plugins/pagebuilder/config/2col_text_photo.php.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php

return [
'title' => 'Two columns: text and image',

// 'show_in_templates' => [ 4 ],

// 'show_in_docs' => [ 2 ],

// 'hide_in_docs' => [ 5 ],

// 'order' => 1,

'image' => 'assets/plugins/pagebuilder/images/2col-text-photo.jpg',

// 'container' => 'default',

'templates' => [
'owner' => '
<div class="container">
<div class="row">
<div class="col-sm-6">
<div class="user-content">
[+richtext+]
</div>
</div>

<div class="col-sm-6">
<img src="[[phpthumb? &input=`[+image+]` &options=`w=540,f=jpg`]]" alt="" class="img-fluid">
</div>
</div>
</div>
',
],

'fields' => [
'image' => [
'caption' => 'Image',
'type' => 'image',
],

'richtext' => [
'caption' => 'Text',
'type' => 'richtext',
'default' => '',
'theme' => 'mini',
'options' => [
'height' => '200px',
],
],
],
];

4 changes: 4 additions & 0 deletions assets/plugins/pagebuilder/config/all_fields.php.sample
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

// 'hide_in_docs' => [ 5 ],

// 'order' => 1,

// 'container' => 'default',

'templates' => [
'owner' => '
<div>Text:<br> [+text+]</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

return [
'title' => 'Page Builder Container',

// 'show_in_templates' => [ 3 ],

// 'show_in_docs' => [ 2 ],

// 'hide_in_docs' => [ 10, 63 ],

// 'addType' => 'images',

'placement' => 'content',

'templates' => [
'owner' => '
<div>
Container:
[+wrap+]
</div>
',
],
];

4 changes: 4 additions & 0 deletions assets/plugins/pagebuilder/config/groups.php.sample
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

// 'hide_in_docs' => [ 10, 63 ],

// 'order' => 2,

// 'container' => ['samplecontainer', 'default'],

'templates' => [
'owner' => '
<div>Text:<br> [+text+]</div>
Expand Down
47 changes: 47 additions & 0 deletions assets/plugins/pagebuilder/config/image-text.php.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php

return [
'title' => 'Image with text',

// 'show_in_templates' => [ 4 ],

// 'show_in_docs' => [ 2 ],

// 'hide_in_docs' => [ 5 ],

// 'order' => 1,

'image' => 'assets/plugins/pagebuilder/images/image-title.jpg',

// 'container' => 'default',

'templates' => [
'owner' => '
<div class="container">
<img src="[[phpthumb? &input=`[+image+]` &options=`w=1110,f=jpg`]]" alt="" class="img-fluid">

<div class="user-content">
[+richtext+]
</div>
</div>
',
],

'fields' => [
'image' => [
'caption' => 'Image',
'type' => 'image',
],

'richtext' => [
'caption' => 'Text',
'type' => 'richtext',
'default' => '',
'theme' => 'mini',
'options' => [
'height' => '100px',
],
],
],
];

33 changes: 33 additions & 0 deletions assets/plugins/pagebuilder/config/image.php.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

return [
'title' => 'Image',

// 'show_in_templates' => [ 4 ],

// 'show_in_docs' => [ 2 ],

// 'hide_in_docs' => [ 5 ],

// 'order' => 1,

'image' => 'assets/plugins/pagebuilder/images/image.jpg',

// 'container' => 'default',

'templates' => [
'owner' => '
<div class="container">
<img src="[[phpthumb? &input=`[+image+]` &options=`w=1110,f=jpg`]]" alt="" class="img-fluid">
</div>
',
],

'fields' => [
'image' => [
'caption' => 'Image',
'type' => 'image',
],
],
];

40 changes: 40 additions & 0 deletions assets/plugins/pagebuilder/config/text.php.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

return [
'title' => 'Text',

// 'show_in_templates' => [ 4 ],

// 'show_in_docs' => [ 2 ],

// 'hide_in_docs' => [ 5 ],

// 'order' => 1,

'image' => 'assets/plugins/pagebuilder/images/text.jpg',

// 'container' => 'default',

'templates' => [
'owner' => '
<div class="container">
<div class="user-content">
[+richtext+]
</div>
</div>
',
],

'fields' => [
'richtext' => [
'caption' => 'Text',
'type' => 'richtext',
'default' => '',
'theme' => 'mini',
'options' => [
'height' => '300px',
],
],
],
];

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/plugins/pagebuilder/images/button.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/plugins/pagebuilder/images/code.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/plugins/pagebuilder/images/devider.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/plugins/pagebuilder/images/gallery.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/plugins/pagebuilder/images/image-title.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/plugins/pagebuilder/images/image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/plugins/pagebuilder/images/introtext.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/plugins/pagebuilder/images/socialmedia.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/plugins/pagebuilder/images/text-photo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/plugins/pagebuilder/images/text.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/plugins/pagebuilder/images/video.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f450494

Please sign in to comment.