Demo cms custom field PS 17
This module is an architectural skeleton for module developers, who want to add custom fields in the cms page on the backoffice. It's a base, you have to adapt it to your needs ... This will save you a lot of time!
cd
your_shop_root_dir/modulesgit
https://github.com/PululuK/democmscustomfields17.git
cd
democmscustomfields17composer
installUpdate the table schema (add or remove fields the custom fields) see here
NOTE : put the multilang fields in democmscustomfields17_lang
table.
Update the model (add or remove fields the custom fields) see here
Update the form (add or remove fields the custom fields) see here
console.log(prestashop.modules.democmscustomfields17.your_field_name);
{$modules.democmscustomfields17.your_field_name}
NOTE : this data is accessible only in the cms pages controller. You can access them outside this controller as follows
<?php
$params = [
'id_cms' => 10,
'id_lang' => 1,
'id_shop' => 3,
];
$myCmsCustomDatas = (new \PrestaShop\Module\Democmscustomfields17\Form\Cms\FormDataHandler())->getData($params);