How to get GrapesJS CMS trait values in the frontend?

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
kdim95
Advanced
Posts: 207
Joined: 26 Aug 2022, 12:17

How to get GrapesJS CMS trait values in the frontend?

Post by kdim95 » 31 Oct 2022, 13:21

Laravel framework version: 9.37.0
Aimeos Laravel version: * 2022.07.2
PHP Version: 8.1.11
Environment: Linux

Hello,

I've created a new trait for the cataloglist component.

The trait is

Code: Select all

{
	type: 'select',
	label: 'Style',
	name: 'list_style',
	options: [
		{id: 'style-1', name: 'Style 1'},
		{id: 'style-2', name: 'Style 2'},
	]
}
Changing the trait triggers a function onListStyleChange, which adds the style id to the cataloglist's classes.

My problem is that I can't figure out how to output the class in the frontend, specifically in:
vendor/aimeos/ai-cms-grapesjs/templates/client/html/cms/page/cataloglist

User avatar
aimeos
Administrator
Posts: 7907
Joined: 01 Jan 1970, 00:00

Re: How to get GrapesJS CMS trait values in the frontend?

Post by aimeos » 31 Oct 2022, 16:36

The values you add by JS in the CMS are read in this class:
https://github.com/aimeos/ai-cms-grapes ... #L107-L117

If you create a PR to add a style class, we will be happy to merge it into the core :-)
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply