Catalog List Component: Unable to Save Custom Field and Rendering Issue

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
alababdiy
Posts: 40
Joined: 30 Apr 2023, 12:46

Catalog List Component: Unable to Save Custom Field and Rendering Issue

Post by alababdiy » 06 Feb 2024, 11:57

I tried to add a custom field to the catalog list component. I added traits to cataloglist.js:

Code: Select all

{ 
    type: 'select',
    label: 'Show Style',
    name: 'style',
    options: [
        { id: 'grid', name: 'grid' },
        { id: 'scroll', name: 'scroll' },
    ]
}

In ./src/Client/Html/Cms/Page/Cataloglist/Standard.php (i override successfully!):

Code: Select all

$style = $node->hasAttribute( 'style' ) ? $node->getAttribute( 'style' ) : 'grid';
// ...
$tview->style = $style;
The new catalog list component field is not savable and also not rendering on ./templates/client/html/cms/page/cataloglist/list.php.

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

Re: Catalog List Component: Unable to Save Custom Field and Rendering Issue

Post by aimeos » 08 Feb 2024, 10:24

"style" will definitely interfere with the HTML style attribute. Use something else like "liststyle".
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

alababdiy
Posts: 40
Joined: 30 Apr 2023, 12:46

Re: Catalog List Component: Unable to Save Custom Field and Rendering Issue

Post by alababdiy » 11 Feb 2024, 07:58

it's work! Thanks

Post Reply