Files
ws_customhtml/ws_customhtml.php
T
isabelle fb641fc236 feat(main): Add custom CSS classes to HTML blocks
This feature allows administrators to define custom CSS classes for individual HTML blocks.
It enhances styling flexibility and integrates with common grid systems (e.g., Bootstrap `col-md-6`)
by applying user-defined classes to the block's wrapper element.

Includes:
- A new `custom_class` field in the block model, form, and data handlers.
- Database schema updates with an upgrade path to handle potential renames from `column_class`.
- Frontend rendering to apply the classes.
- Registration of `actionFrontControllerSetMedia` hook to load front-end CSS.
- Basic responsive image styling for blocks.
2026-08-13 11:33:24 +02:00

44 lines
1.2 KiB
PHP

<?php
/**
* 2007-2024 De Websmid BV
*
* @author Isabelle Oving-Anno | De Websmid BV <isabelle@dewebsmid.nl>
* @copyright 2007-2024 De Websmid BV
* @license MIT
*/
use Websmid\CustomHtml\Module\Install;
use Websmid\CustomHtml\Module\AdminHooks;
use Websmid\CustomHtml\Module\DisplayHooks;
use PrestaShop\PrestaShop\Core\Module\WidgetInterface;
if (!defined('_PS_VERSION_')) {
exit;
}
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
require_once __DIR__ . '/vendor/autoload.php';
}
class Ws_CustomHtml extends Module implements WidgetInterface
{
use Install;
use AdminHooks;
use DisplayHooks;
public function __construct()
{
$this->name = 'ws_customhtml';
$this->version = '1.5.0';
$this->author = 'Isabelle Oving-Anno | De Websmid BV';
$this->need_instance = 0;
$this->bootstrap = true;
parent::__construct();
$this->displayName = $this->trans('Custom HTML', [], 'Modules.Wscustomhtml.Admin');
$this->description = $this->trans('Create and manage custom HTML blocks for frontend hooks.', [], 'Modules.Wscustomhtml.Admin');
$this->ps_versions_compliancy = ['min' => '1.7.0.0', 'max' => _PS_VERSION_];
}
}