diff --git a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql index 3a25b7030e0..b3b290aa4fd 100644 --- a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql +++ b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql @@ -133,6 +133,7 @@ ALTER TABLE llx_website_page CHANGE COLUMN fk_user_create fk_user_creat integer; ALTER TABLE llx_website ADD COLUMN maincolor varchar(16); ALTER TABLE llx_website ADD COLUMN maincolorbis varchar(16); +ALTER TABLE llx_website_page ADD COLUMN image varchar(255); CREATE TABLE llx_takepos_floor_tables( rowid integer AUTO_INCREMENT PRIMARY KEY, diff --git a/htdocs/install/mysql/tables/llx_website_page.sql b/htdocs/install/mysql/tables/llx_website_page.sql index 3c872f00dac..6d32805dc3f 100644 --- a/htdocs/install/mysql/tables/llx_website_page.sql +++ b/htdocs/install/mysql/tables/llx_website_page.sql @@ -26,6 +26,7 @@ CREATE TABLE llx_website_page aliasalt varchar(255), title varchar(255), description varchar(255), + image varchar(255), keywords varchar(255), lang varchar(6), fk_page integer, diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index e8cd9b78d2f..3a36c6d89ed 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -260,5 +260,7 @@ WebsiteSetup=Setup of module website WEBSITE_PAGEURL=URL of page WEBSITE_TITLE=Title WEBSITE_DESCRIPTION=Description +WEBSITE_IMAGE=Image +WEBSITE_IMAGEDesc=Relative path of the image media. You can keep this empty as this is rarely used (it can be used when container is of type 'blog_post' to show a preview of a news in some pages with dynamic content of Blog Posts. WEBSITE_KEYWORDS=Keywords LinesToImport=Lines to import diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 6f8713b5adc..4210e5981de 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -57,14 +57,24 @@ class WebsitePage extends CommonObject public $pageurl; public $aliasalt; public $type_container; - public $title; + /** + * @var string title + */ + public $title; /** * @var string description */ public $description; - + /** + * @var string image + */ + public $image; + /** + * @var string keywords + */ public $keywords; + public $htmlheader; public $content; public $grabbed_from; @@ -89,7 +99,8 @@ class WebsitePage extends CommonObject 'type_container' =>array('type'=>'varchar(16)', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'index'=>0, 'position'=>12, 'comment'=>'Type of container'), 'title' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1), 'description' =>array('type'=>'varchar(255)', 'label'=>'Description', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1), - 'keywords' =>array('type'=>'varchar(255)', 'label'=>'Keywords', 'enabled'=>1, 'visible'=>1, 'position'=>45, 'searchall'=>0), + 'image' =>array('type'=>'varchar(255)', 'label'=>'Image', 'enabled'=>1, 'visible'=>1, 'position'=>32, 'searchall'=>0, 'help'=>'Relative path of media. Used if Type is "blog_post"'), + 'keywords' =>array('type'=>'varchar(255)', 'label'=>'Keywords', 'enabled'=>1, 'visible'=>1, 'position'=>45, 'searchall'=>0), 'lang' =>array('type'=>'varchar(6)', 'label'=>'Lang', 'enabled'=>1, 'visible'=>1, 'position'=>45, 'searchall'=>0), //'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'index'=>true, 'position'=>1000), 'fk_website' =>array('type'=>'integer', 'label'=>'WebsiteId', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>40, 'searchall'=>0, 'foreignkey'=>'websitepage.rowid'), diff --git a/htdocs/website/index.php b/htdocs/website/index.php index f37f0d79538..1951fe379fa 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2468,6 +2468,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') if (GETPOST('WEBSITE_PAGENAME','alpha')) $pageurl=GETPOST('WEBSITE_PAGENAME','alpha'); if (GETPOST('WEBSITE_ALIASALT','alpha')) $pagealiasalt=GETPOST('WEBSITE_ALIASALT','alpha'); if (GETPOST('WEBSITE_DESCRIPTION','alpha')) $pagedescription=GETPOST('WEBSITE_DESCRIPTION','alpha'); + if (GETPOST('WEBSITE_IMAGE','alpha')) $pageimage=GETPOST('WEBSITE_IMAGE','alpha'); if (GETPOST('WEBSITE_KEYWORDS','alpha')) $pagekeywords=GETPOST('WEBSITE_KEYWORDS','alpha'); if (GETPOST('WEBSITE_LANG','aZ09')) $pagelang=GETPOST('WEBSITE_LANG','aZ09'); if (GETPOST('htmlheader','none')) $pagehtmlheader=GETPOST('htmlheader','none'); @@ -2508,6 +2509,13 @@ if ($action == 'editmeta' || $action == 'createcontainer') print ''; print ''; + print '