oveleon / contao-component-style-manager Goto Github PK
View Code? Open in Web Editor NEWThis extension is for the Contao CMS and allows you to easily manage and provide custom categories and groups for CSS classes.
License: MIT License
This extension is for the Contao CMS and allows you to easily manage and provide custom categories and groups for CSS classes.
License: MIT License
Hi. First thx for your cool extension.
Since the update 2.6.2 i get the following error in the frontend.
Error:
Attempt to assign property "styleManager" on null
at vendor/oveleon/contao-component-style-manager/src/Resources/contao/classes/StyleManager.php:393
at Oveleon\ContaoComponentStyleManager\StyleManager->onGeneratePage(object(PageModel), object(LayoutModel), object(PageRegular))
(vendor/contao/core-bundle/src/Resources/contao/pages/PageRegular.php:191)
at Contao\PageRegular->prepare(object(PageModel))
(vendor/contao/core-bundle/src/Resources/contao/pages/PageRegular.php:48)
at Contao\PageRegular->getResponse(object(PageModel), true)
(vendor/contao/core-bundle/src/Resources/contao/controllers/FrontendIndex.php:337)
at Contao\FrontendIndex->renderPage(object(PageModel))
(vendor/symfony/http-kernel/HttpKernel.php:158)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
(vendor/symfony/http-kernel/HttpKernel.php:80)
at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
(vendor/symfony/http-kernel/Kernel.php:201)
at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
(web/index.php:31)
If i downgrade to 2.6.1, everything works fine.
I´m running contao 4.9.24 with php 8.0
I use your extension the first time and it looks very promising. Seems like I found a worthy successor of stylepicker4ward. One thing I miss in a multi domain setup is that styles can be limited for different themes and only applied if the page uses a layout of the theme (I know in news etc you don't have the relation).
In my point of view, the style should belong to a theme and should be import and export able using the Contao theme support. Wdyt?
Would you be able to supply a importable Template for bootstrap on installation?
Hello!
I tried to use your really promisful extension - but unfortunately I failed.
In the Backend everything seems to work as expected, but I could not manage to get the Class into my fe_page.html5 Template.
The compatibility is declared for up to 4.9 but is it possible that it does not work with Contao 4.12.4 or with php 8?
I added this to the template and "testtest" is the category identifier:
styleManager->get('testtest')?>thanks,
Fanni
If a user does not have access to the cssID field in permissions but only the style manager, the configuration does not fully work. It seems a user can add a class, but when removing it it remains in the cssID field.
Backend (PHP/CSS)
Contao: 5.2.7
PHP 8.1.25
oveleon/contao-component-style-manager: 3.4.2
--
After composer update from Contao 5.2.6 to 5.2.7 (and all the symfony upgrades to v6.4.0) your bundle is throwing following error on cache clear.
Can you help me with this?
In FileLoader.php line 182:
Route alias "Oveleon\ContaoComponentStyleManager\Controller\BackendModule\I
mportController" can not reference itself in vendor/oveleon/contao-component-style-manager/src/Controller (which is be
ing imported from "/vendor/oveleon/contao-co
mponent-style-manager/src/ContaoManager/../Resources/config/routes.yaml").
Make sure there is a loader supporting the "annotation" type.
In RouteCollection.php line 375:
Route alias "Oveleon\ContaoComponentStyleManager\Controller\BackendModule\I
mportController" can not reference itself.
I have the version 3.2 installed in a Contao 4.13.16. When I click on a content element to edit it, I get the following message:
[2023-03-23T12:14:11.694056+01:00] request.INFO: Matched route "contao_backend". {"route":"contao_backend","route_parameters":{"_route":"contao_backend","_scope":"backend","_token_check":true,"_controller":"Contao\\CoreBundle\\Controller\\BackendController::mainAction"},"request_uri":"https://www.edukativa.eu/contao?act=edit&do=article&id=14&ref=dr5T2Czz&rt=048c3fc36d2ded5dbe83a8dbeef7e.PJLr2Al6GOLjPS61WaM6ybSWDZe-eoJr8reLcRHq9hQ.UfCT7WE2TKGtambZGOd4mef6SdLNLcAllY7hCyTesGNI3aCeRTB3hoZeWQ&table=tl_content","method":"GET"} [] [2023-03-23T12:14:11.853586+01:00] request.CRITICAL: Uncaught PHP Exception TypeError: "Cannot access offset of type string on string" at /homepages/8/d618066693/htdocs/contao_live/vendor/oveleon/contao-component-style-manager/src/StyleManager/StyleManager.php line 241 {"exception":"[object] (TypeError(code: 0): Cannot access offset of type string on string at /homepages/8/d618066693/htdocs/contao_live/vendor/oveleon/contao-component-style-manager/src/StyleManager/StyleManager.php:241)"} []
Any Ideas how to resolve this?
Bei Test einer Installation mit Contao 4.13 RC2 mit dem Style-Manager ist mir aufgefallen, dass sich folgende Tabelle im Installtool nicht ändern lässt:
ALTER TABLE tl_style_manager CHANGE alias alias VARCHAR(255) DEFAULT '' NOT NULL COLLATE 'utf8_bin'
Ist das ein Problem in meinen Einstellungen oder tatsächlich ein Problem der Erweiterung?
Im Backend und im Frontend konnte ich auf den ersten Blick keinerlei Fehler feststellen.
Im Debug-Modus gibt es auch keine Fehler.
Contao 4.13 RC2
XAMPP mit PHP 7.4.27
Windows 10
In einer frischen Contao 4.13 Installation mit Thememanager 1.5.2 und StyleManager Version 3.0.2 werden die Klassen in der Auswahl mehrfach bzw. unvollständig angezeigt.
Habe die style-manager-core.xml Bundle-Konfigurationen importiert, was eigentlich gar nicht notwendig ist.
Backend (PHP/CSS)
Before updating to Contao 5.x, the StyleManager Widget would remember the state of an open CSS-group (tab).
This feature is broken in Contao 5.2.
No response
Hey,
mir ist eine Sache aufgefallen - evtl. ist das ja ein Feature wert :-)
ich arbeite sehr viel mit eigenen Inhaltselementen und da ist es immer recht mühsam hinterher in jeder CSS-Gruppe das neue Inhaltselement neu auszuwählen.
Eventuell gibt es ja die Chance, dass man bei den Kategorien bereits die Elemente auswählen kann und das dann automatisch auf die Unterelemente angewandt wird.
Danke, ansonsten super Erweiterung :-)
I really like your extension, it's great for a customizable frontend. I directly installed the new Version 2.0 today to test the new features.
At first sight everything worked fine, but now, when I want to edit an article containing an element with an image (or showing the same element in the frontend), it gives me the error "Cannot use object of type Oveleon\ContaoComponentStyleManager\Styles as array". The same thing shows up, if I change the content type of an element from text to image and then click "save and close".
The respective log file output is
[2020-01-10 00:50:19] request.CRITICAL: Uncaught PHP Exception Error: "Cannot use object of type Oveleon\ContaoComponentStyleManager\Styles as array" at /Users/Raphael/Development/rl-contao-theme-multi/vendor/oveleon/contao-component-style-manager/src/Resources/contao/classes/StyleManager.php line 342 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Cannot use object of type Oveleon\\ContaoComponentStyleManager\\Styles as array at /Users/Raphael/Development/rl-contao-theme-multi/vendor/oveleon/contao-component-style-manager/src/Resources/contao/classes/StyleManager.php:342)"} []
Is there a way you could fix this? I would really like to continue to use your extension.
Ich habe das Modul bei einem Projekt mit Contao 4.9.1 im Einsatz. Hier hat alles wunderbar funktioniert.
Nach einem Update auf 4.9.2 werden die Klassen-Einstellungen nicht mehr ans Template übergeben.
Das entfernen einer bestehenden Klasse funktioniert.
Beim Versuch die Klasse wieder auszuwählen und somit erneuten hinzuzufügen scheitert jedoch.
Hello, I like this extension. I also tried theme-toolbox but your extension has more options. But theme-toolbox has this nice feature to deactivate the SCSS cache. Will you please add this feature to your extension so I don't have to install both extensions?
erdmannfreunde/theme-toolbox#15 (comment)
It would be helpful if there is in each category the possibility to add one or more base classes, which will be added at the beginning in any case when selecting a CSS group.
Unfortunately, the migration for v3 ends with the following error Cannot execute queries while other unbuffered queries are active
in some of my contao instances while running contao-console contao:migrate
(with backup!).
Exception trace:
at /httpdocs/vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28
Doctrine\DBAL\Driver\PDO\Exception::new() at /httpdocs/vendor/doctrine/dbal/src/Driver/PDO/Connection.php:74
Doctrine\DBAL\Driver\PDO\Connection->query() at /httpdocs/vendor/doctrine/dbal/src/Connection.php:1065
Doctrine\DBAL\Connection->executeQuery() at /httpdocs/vendor/contao/core-bundle/src/Resources/contao/library/Contao/Database/Statement.php:284
Contao\Database\Statement->query() at /httpdocs/vendor/contao/core-bundle/src/Resources/contao/library/Contao/Database/Statement.php:240
Contao\Database\Statement->execute() at /httpdocs/vendor/contao/core-bundle/src/Resources/contao/library/Contao/Model.php:1174
Contao\Model::countBy() at /httpdocs/vendor/contao/core-bundle/src/Resources/contao/library/Contao/Model.php:1184
Contao\Model::countAll() at /httpdocs/vendor/oveleon/contao-component-style-manager/src/StyleManager/Sync.php:43
Oveleon\ContaoComponentStyleManager\StyleManager\Sync->shouldRunObjectConversion() at /httpdocs/vendor/oveleon/contao-component-style-manager/src/Migration/Version30/ObjectConversionMigration.php:48
Oveleon\ContaoComponentStyleManager\Migration\Version30\ObjectConversionMigration->shouldRun() at /httpdocs/vendor/contao/core-bundle/src/Migration/MigrationCollection.php:47
Contao\CoreBundle\Migration\MigrationCollection->getPending() at /httpdocs/vendor/contao/core-bundle/src/Migration/MigrationCollection.php:58
Contao\CoreBundle\Migration\MigrationCollection->getPendingNames() at /httpdocs/vendor/contao/core-bundle/src/Command/MigrateCommand.php:257
Contao\CoreBundle\Command\MigrateCommand->executeMigrations() at /httpdocs/vendor/contao/core-bundle/src/Command/MigrateCommand.php:208
Contao\CoreBundle\Command\MigrateCommand->executeCommand() at /httpdocs/vendor/contao/core-bundle/src/Command/MigrateCommand.php:109
Contao\CoreBundle\Command\MigrateCommand->execute() at /httpdocs/vendor/symfony/console/Command/Command.php:298
Symfony\Component\Console\Command\Command->run() at /httpdocs/vendor/symfony/console/Application.php:1058
Symfony\Component\Console\Application->doRunCommand() at /httpdocs/vendor/symfony/framework-bundle/Console/Application.php:96
Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /httpdocs/vendor/symfony/console/Application.php:301
Symfony\Component\Console\Application->doRun() at /httpdocs/vendor/symfony/framework-bundle/Console/Application.php:82
Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /httpdocs/vendor/symfony/console/Application.php:171
Symfony\Component\Console\Application->run() at /httpdocs/vendor/contao/manager-bundle/bin/contao-console:38
include() at /httpdocs/vendor/bin/contao-console:120
this trace leads me to this line:
this count line should get refactored - but I'm not sure how 😞
Maybe @fritzmg can help?
seems to be related to :
https://contao.slack.com/archives/CK4J0KNDB/p1664471331144309
https://contao.slack.com/archives/CK4J0KNDB/p1665012397236239
It would be nice to have a description field for each style group, to describe the functionality of the group. Should not be that much expenditure, or am I wrong?
After installation, the message "StyleManager configurations were successfully converted. Please note, if custom tables have been added to the StyleManager, they must be migrated using the contao:stylemanager:object-conversion table
command." keeps appearing in the Contao Manager or the Install tool. No custom tables used.
Hello,
I am unable to create select
s with optgroup
. And I think it's impossible to, according to the ComponentStyleSelect
widget's current code.
I managed to make it work with those slight modifications (starting line 140) :
foreach ($opts as $opt) {
$arrFieldOption = array(
'label' => $opt['value'] ?: $opt['key'],
'value' => $opt['key']
);
// if 'value' is an array, we format the subvalues the same way
if(is_array($arrFieldOption['value'])){
foreach($arrFieldOption['value'] as $arrFieldSuvOption){
$arrFieldOption['value'][] = array(
'label' => $arrFieldSuvOption['value'] ?: $arrFieldSuvOption['key'],
'value' => $arrFieldSuvOption['key']
);
}
}
$arrFieldOptions[] = $arrFieldOption;
}
// set options
$strFieldId = $this->strId . '_' . $objStyleGroups->id;
$strFieldName = $this->strName . '[' . $objStyleGroups->id . ']';
foreach ($arrFieldOptions as $strKey=>$arrOption)
{
if (!is_array($arrOption['value'])) // if not an array, we want to create a single <option>. Otherwise, it's an <optgroup>
{
// nothing changed here, keep original code
}
else
{
$arrOptgroups = array();
foreach ($arrOption['value'] as $arrOptgroup)
{
$arrOptgroups[] = sprintf('<option value="%s"%s>%s</option>',
StringUtil::specialchars($arrOptgroup['value']),
// @deprecated: to be removed in Version 3.0. (interception of storage based on the alias. In future, only the ID must be set)
static::optionSelected($arrOptgroup['value'], $this->varValue[ $objStyleGroups->id ] ?? '') ?: static::optionSelected($arrOptgroup['value'], $this->varValue[ $objStyleGroups->alias ] ?? ''),
$arrOptgroup['label']);
}
$arrOptions[] = sprintf('<optgroup label=" %s">%s</optgroup>', StringUtil::specialchars($arrOption['label']), implode('', $arrOptgroups));
}
}
This code has been manually tested on my simple case, I don't know if it is "robust" enough to handle other cases.
Contao 4.13.32
Contao Stylemanager 3.4.1
PHP 8.2.12
MariaDB 10.5.21
Hoster:Hostingwerk
Nach der Deinstallation der Erweiterung lassen sich einige Felder nicht aktualisieren.
Hier die Konsolenausgabe:
ALTER TABLE tl_article CHANGE cssID cssID VARCHAR(255) DEFAULT '' NOT NULL
ALTER TABLE tl_content CHANGE cssID cssID VARCHAR(255) DEFAULT '' NOT NULL
ALTER TABLE tl_layout CHANGE cssClass cssClass VARCHAR(255) DEFAULT '' NOT NULL
ALTER TABLE tl_module CHANGE cssID cssID VARCHAR(255) DEFAULT '' NOT NULL
ALTER TABLE tl_page CHANGE cssClass cssClass VARCHAR(64) DEFAULT '' NOT NULL
Template (HTML/Twig)
Ich habe gerade ein Contao LTS 5.3.7 installiert mit ThemeManager und Komponenten StyleManager
Habe dann in den StyleManager alles importiert.
Wenn ich nun den Manager nutzen möchte sehe ich Einträge doppelt und manche gar nicht. Denke aber das hinter einen der doppelten Einträge der nicht zu sehene Eintrag ist.
Einmal ein paar Screenshots vom StyleManager Admin und vom Layout Bereich wo man diesen nutzt.
Hier habe ich keinen Output
I installed Style Manager in v3.0.0 on Contao 4.13.13 with PHP 8.1.11 and imported my XML-Asset. When I open a Content Element I got the following error:
TypeError:
Cannot assign null to property Oveleon\ContaoComponentStyleManager\StyleManager\Config::$arrArchive of type array
at vendor/oveleon/contao-component-style-manager/src/StyleManager/Config.php:138
at Oveleon\ContaoComponentStyleManager\StyleManager\Config->__construct()
(vendor/oveleon/contao-component-style-manager/src/StyleManager/Config.php:158)
at Oveleon\ContaoComponentStyleManager\StyleManager\Config::getInstance()
(vendor/oveleon/contao-component-style-manager/src/Model/StyleManagerArchiveModel.php:68)
at Oveleon\ContaoComponentStyleManager\Model\StyleManagerArchiveModel::findAllWithConfiguration(array('order' => 'sorting'))
(vendor/oveleon/contao-component-style-manager/src/Widget/ComponentStyleSelect.php:53)
at Oveleon\ContaoComponentStyleManager\Widget\ComponentStyleSelect->generate()
(vendor/contao/core-bundle/src/Resources/contao/library/Contao/Widget.php:660)
at Contao\Widget->generateWithError(true)
(vendor/contao/core-bundle/src/Resources/contao/templates/backend/be_widget.html5:3)
at include('/htdocs/vendor/contao/core-bundle/src/Resources/contao/templates/backend/be_widget.html5')
(vendor/contao/core-bundle/src/Resources/contao/library/Contao/TemplateInheritance.php:108)
at Contao\Widget->inherit()
(vendor/contao/core-bundle/src/Resources/contao/library/Contao/Widget.php:607)
at Contao\Widget->parse()
(vendor/contao/core-bundle/src/Resources/contao/classes/DataContainer.php:795)
at Contao\DataContainer->row('{type_legend},type,subline,headline;{template_legend:hide},customTpl;{protected_legend:hide},protected;{style_manager_legend},styleManager;{expert_legend:hide},guests,hofff_toc_include,cssID;{invisible_legend:hide},invisible,start,stop;{includeinfo_legend:hide},includeInfo')
(vendor/contao/core-bundle/src/Resources/contao/drivers/DC_Table.php:1973)
at Contao\DC_Table->edit()
(vendor/contao/core-bundle/src/Resources/contao/classes/Backend.php:667)
at Contao\Backend->getBackendModule('article', null)
(vendor/contao/core-bundle/src/Resources/contao/controllers/BackendMain.php:168)
at Contao\BackendMain->run()
(vendor/contao/core-bundle/src/Controller/BackendController.php:49)
at Contao\CoreBundle\Controller\BackendController->mainAction()
(vendor/symfony/http-kernel/HttpKernel.php:163)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
(vendor/symfony/http-kernel/HttpKernel.php:75)
at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
(vendor/symfony/http-kernel/Kernel.php:202)
at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
(public/index.php:44)
Any idea or is there something, I've missed?
It would be nice to have the possibility to set a default value for a specific group. For example "gridColumns - Columns" -> Default value 12 Columns...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.