Основные функции:
- Drag & Drop интерфейс с поддержкой вложенности
- Визуальное редактирование контента через TinyMCE
- Интеграция с TV параметрами Evolution CMS
- Библиотека готовых блоков из GitHub репозитория
- Панель свойств для тонкой настройки элементов
- Контекстное меню с операциями копирования/вставки
- Сохранение и загрузка структуры страницы
- Экспорт чистого HTML кода
- TinyMCE 4
Выполните команды из директории /core:
- Установка пакета
php artisan package:installrequire roilafx/constructorevo "*"
- Публикация стилей и скриптов
php artisan vendor:publish --provider="roilafx\constructor\constructorServiceProvider"
- Откройте любой документ в админке Evolution CMS
- Перейдите на вкладку "Конструктор"
- Перетащите элемент "Строка" в рабочую область
- Внутрь строки добавьте "Колонку"
- В колонку добавьте "Контент"
- Дважды кликните по тексту для редактирования
- Создайте TV параметр в админке Evolution
- Привяжите его к шаблону страницы
- В конструкторе перетащите TV параметр из боковой панели
- Настройте отображение через панель свойств
- Нажмите на иконку "Библиотека" в боковой панели
- Выберите категорию (Страницы, Секции, Блоки)
- Нажмите "+" на выбранном блоке
- Готовый блок появится в рабочей области
[!documentBuilder!]
{!! evo()->runSnippet('documentBuilder') !!}// В ElementService.php
public function getRepositories(): array
{
return [
[
'id' => 'my-blocks',
'name' => 'Мои блоки',
'url' => 'https://api.github.com/repos/username/constructor-blocks/contents/',
'type' => 'github',
'branch' => 'main'
]
];
}{
"title": "Название блока",
"description": "Описание блока",
"type": "section",
"tags": ["bootstrap", "responsive", "tv:price"],
"preview": "https://.../preview.png",
"elements": [
{
"type": "row",
"index": "0",
"parentIndex": null,
"values": {}
}
]
}| Поле | Тип | Обязательное | Описание |
|---|---|---|---|
title |
string | Да | Название блока |
description |
string | Нет | Описание |
type |
string | Да | page, section, block |
tags |
array | Нет | Теги для поиска |
preview |
string | Нет | URL превью |
elements |
array | Да | Массив элементов |
[
{
"id": "",
"type": "column",
"index": "0",
"config": "column",
"values": {
"styles": "",
"classes": "constructor-element",
"attributes": [],
"dropZoneStyles": "display: flex; flex-direction: column; gap: 16px; padding: 12px;",
"dropZoneClasses": "drop-zone"
},
"visible": "1",
"container": "workspace",
"parentIndex": null
},
{
"id": "",
"type": "content",
"index": "1",
"config": "content",
"values": {
"styles": "",
"classes": "constructor-element",
"content": "<p>Нажмите кнопку редактирования для добавления контента</p>",
"attributes": [],
"innerStyles": "",
"innerClasses": "content-holder"
},
"visible": "1",
"container": "workspace",
"parentIndex": 0
},
{
"id": "",
"type": "content",
"index": "2",
"config": "content",
"values": {
"styles": "",
"classes": "constructor-element selected",
"content": "<p>Нажмите кнопку редактирования для добавления контента</p>",
"attributes": [],
"innerStyles": "",
"innerClasses": "content-holder"
},
"visible": "1",
"container": "workspace",
"parentIndex": 0
}
][
{
"id": "",
"type": "row",
"index": "0",
"config": "row",
"values": {
"styles": "padding: 40px 20px;",
"classes": "constructor-element product-section",
"attributes": {
"data-index": "0"
},
"dropZoneStyles": "display: flex; flex-direction: row; gap: 40px; max-width: 1200px; margin: 0px auto;",
"dropZoneClasses": "drop-zone container"
},
"visible": "1",
"container": "workspace",
"parentIndex": null
},
{
"id": "",
"type": "column",
"index": "1",
"config": "column",
"values": {
"styles": "flex: 1 1 0%;",
"classes": "constructor-element",
"attributes": {
"data-index": "1"
},
"dropZoneStyles": "display: flex; flex-direction: column; gap: 20px;",
"dropZoneClasses": "drop-zone"
},
"visible": "1",
"container": "workspace",
"parentIndex": 0
},
{
"id": "",
"type": "column",
"index": "2",
"config": "column",
"values": {
"styles": "flex: 1 1 0%;",
"classes": "constructor-element",
"attributes": {
"data-index": "2"
},
"dropZoneStyles": "display: flex; flex-direction: column; gap: 20px;",
"dropZoneClasses": "drop-zone"
},
"visible": "1",
"container": "workspace",
"parentIndex": 0
},
{
"id": "",
"type": "tv",
"index": "3",
"config": "tv",
"values": {
"alt": "test",
"tvId": "1",
"styles": "",
"tvName": "test",
"tvType": "image",
"classes": "constructor-element selected",
"content": "{{$documentObject['test']}}",
"attributes": {
"data-index": "3",
"data-tv-id": "1",
"data-tv-name": "test",
"data-tv-type": "image"
},
"targetStyles": "max-width: 100%;",
"targetClasses": ""
},
"visible": "1",
"container": "workspace",
"parentIndex": 1
},
{
"id": "",
"type": "content",
"index": "4",
"config": "content",
"values": {
"styles": "",
"classes": "constructor-element",
"content": "<h1 style=\"font-size: 32px; color: #333;\">Название товара</h1>",
"attributes": {
"data-index": "4"
},
"innerStyles": "",
"innerClasses": "content-holder content-holder content-holder content-holder content-holder"
},
"visible": "1",
"container": "workspace",
"parentIndex": 2
},
{
"id": "",
"type": "content",
"index": "5",
"config": "content",
"values": {
"styles": "",
"classes": "constructor-element",
"content": "<p style=\"font-size: 24px; color: #667eea; font-weight: bold;\">9 990 ₽</p>",
"attributes": {
"data-index": "5"
},
"innerStyles": "",
"innerClasses": "content-holder content-holder content-holder content-holder content-holder product-price"
},
"visible": "1",
"container": "workspace",
"parentIndex": 2
},
{
"id": "",
"type": "content",
"index": "6",
"config": "content",
"values": {
"styles": "",
"classes": "constructor-element",
"content": "<p style=\"color: #666; line-height: 1.6;\">Описание товара. Здесь можно рассказать о характеристиках, преимуществах и особенностях продукта.</p>",
"attributes": {
"data-index": "6"
},
"innerStyles": "",
"innerClasses": "content-holder content-holder content-holder content-holder content-holder product-description"
},
"visible": "1",
"container": "workspace",
"parentIndex": 2
},
{
"id": "",
"type": "button",
"index": "7",
"config": "button",
"values": {
"styles": "",
"classes": "constructor-element",
"content": "Добавить в корзину",
"disabled": false,
"attributes": {
"data-index": "7"
},
"buttonType": "submit",
"innerStyles": "background: rgb(102, 126, 234); color: white; border: none; padding: 12px 30px; border-radius: 5px; font-size: 16px; cursor: pointer; transition: background 0.3s;",
"innerClasses": "btn btn-primary btn-lg"
},
"visible": "1",
"container": "workspace",
"parentIndex": 2
}
]- Создайте JSON файл в папке
blocks/ - Закоммитьте в GitHub
- Блок появится в библиотеке конструктора
Проверьте:
- Правильно ли указан URL репозитория
- Доступен ли GitHub API (нет блокировки CORS)
- Есть ли JSON файлы в указанной папке
Проверьте:
- Подключен ли редактор в Evolution CMS
- Есть ли конфликт версий TinyMCE
- Правильно ли указан селектор
- Evolution CMS Team за отличную платформу
- Сообществу Evolution за идеи и тестирование
- Всем пользователям конструктора