Extend Product/Text
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!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Extend Product/Text
Hi Aimeos Team,
I tried to extend Product/Text, as shown in the attachment. Extending the template was´nt the problem but now, I struggled with save and retrieve the data.
I´ve looked into https://aimeos.org/docs/2021.x/models/e ... custom-way but I dont know the "connection" beetween my own Text/Lists/Manager to include the "contentimage" and extend the product.lists-table
With extending config/mshop/product.php, the product-tab shows a SQL-Syntax-Error:
Thank you!
I tried to extend Product/Text, as shown in the attachment. Extending the template was´nt the problem but now, I struggled with save and retrieve the data.
I´ve looked into https://aimeos.org/docs/2021.x/models/e ... custom-way but I dont know the "connection" beetween my own Text/Lists/Manager to include the "contentimage" and extend the product.lists-table
With extending config/mshop/product.php, the product-tab shows a SQL-Syntax-Error:
Code: Select all
return array(
'manager' => array(
'lists' => array(
'insert' => array(
'ansi' => '
INSERT INTO "mshop_product_list" ( :names
"parentid", "key", "type", "domain", "refid", "start", "end",
"config", "pos", "status", "mtime", "editor", "siteid", "ctime", "contentimage"
) VALUES ( :values
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
)
'
),
'update' => array(
'ansi' => '
UPDATE "mshop_product_list"
SET :names
"parentid" = ?, "key" = ?, "type" = ?, "domain" = ?, "refid" = ?, "start" = ?,
"end" = ?, "config" = ?, "pos" = ?, "status" = ?, "mtime" = ?, "editor" = ?, "contentimage" = ?
WHERE "siteid" LIKE ? AND "id" = ?
'
),
'search' => array(
'ansi' => '
SELECT :columns
mproli."id" AS "product.lists.id", mproli."parentid" AS "product.lists.parentid",
mproli."siteid" AS "product.lists.siteid", mproli."type" AS "product.lists.type",
mproli."domain" AS "product.lists.domain", mproli."refid" AS "product.lists.refid",
mproli."start" AS "product.lists.datestart", mproli."end" AS "product.lists.dateend",
mproli."config" AS "product.lists.config", mproli."pos" AS "product.lists.position",
mproli."status" AS "product.lists.status", mproli."mtime" AS "product.lists.mtime",
mproli."editor" AS "product.lists.editor", mproli."ctime" AS "product.lists.ctime",
mproli."contentimage" AS "product.lists.contentimage"
FROM "mshop_product_list" mproli
:joins
WHERE :cond
ORDER BY :order
OFFSET :start ROWS FETCH NEXT :size ROWS ONLY
',
'mysql' => '
SELECT :columns
mproli."id" AS "product.lists.id", mproli."parentid" AS "product.lists.parentid",
mproli."siteid" AS "product.lists.siteid", mproli."type" AS "product.lists.type",
mproli."domain" AS "product.lists.domain", mproli."refid" AS "product.lists.refid",
mproli."start" AS "product.lists.datestart", mproli."end" AS "product.lists.dateend",
mproli."config" AS "product.lists.config", mproli."pos" AS "product.lists.position",
mproli."status" AS "product.lists.status", mproli."mtime" AS "product.lists.mtime",
mproli."editor" AS "product.lists.editor", mproli."ctime" AS "product.lists.ctime",
mproli."contentimage" AS "product.lists.contentimage"
FROM "mshop_product_list" mproli
:joins
WHERE :cond
ORDER BY :order
LIMIT :size OFFSET :start
'
),
),
),
);
- Attachments
-
- screenshot-aimeos.local-2023.02.23-15_37_59.png (70.37 KiB) Viewed 1361 times
Re: Extend Product/Text
Well, there's none for good reasons! Usually, you want to keep things separate and upload an image with a new type instead in the media panel to be able to enforce the layout in the frontend.
If you really want to directly connect texts and images and let the editor influence the layout (which then may look broken), you can store the uploaded file by the media manager and add an hint to the ID of the media item in the "config" field of the list item. In the frontend, you have to bring that together based on the "config" value.
If you really want to directly connect texts and images and let the editor influence the layout (which then may look broken), you can store the uploaded file by the media manager and add an hint to the ID of the media item in the "config" field of the list item. In the frontend, you have to bring that together based on the "config" value.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star