diff --git a/bl-kernel/admin/views/settings.php b/bl-kernel/admin/views/settings.php index 5159cfdb..e348ac28 100644 --- a/bl-kernel/admin/views/settings.php +++ b/bl-kernel/admin/views/settings.php @@ -74,6 +74,16 @@ echo Bootstrap::formInputHidden(array( 'tip' => $L->g('you-can-add-a-site-description-to-provide') )); + echo Bootstrap::formTextarea(array( + 'name' => 'homepagePresentation', + 'label' => $L->g('Homepage'), + 'value' => $site->homepagePresentation(), + 'class' => '', + 'placeholder' => '', + 'tip' => '', + 'rows' => 8 + )); + echo Bootstrap::formInputText(array( 'name' => 'footer', 'label' => $L->g('Footer text'), diff --git a/bl-kernel/helpers/theme.class.php b/bl-kernel/helpers/theme.class.php index bb842013..11a83af3 100644 --- a/bl-kernel/helpers/theme.class.php +++ b/bl-kernel/helpers/theme.class.php @@ -411,6 +411,20 @@ class Theme return $FONTAWESOME; } + public static function getHomepagePresentation() + { + global $site; + $content = $site->homepagePresentation(); + + // Parse Markdown + if (MARKDOWN_PARSER) { + $parsedown = new Parsedown(); + $content = $parsedown->text($content); + } + + return $content; + } + public static function jsSortable($attributes = '') { // https://github.com/psfpro/bootstrap-html5sortable diff --git a/bl-kernel/site.class.php b/bl-kernel/site.class.php index a48cf730..022f126c 100644 --- a/bl-kernel/site.class.php +++ b/bl-kernel/site.class.php @@ -6,6 +6,7 @@ class Site extends dbJSON 'title' => 'I am Guybrush Threepwood, mighty developer', 'slogan' => '', 'description' => '', + 'homepagePresentation' => '', 'footer' => 'I wanna be a pirate!', 'itemsPerPage' => 6, 'language' => 'en', @@ -282,6 +283,11 @@ class Site extends dbJSON return $this->getField('description'); } + public function homepagePresentation() + { + return $this->getField('homepagePresentation'); + } + public function emailFrom() { return $this->getField('emailFrom'); diff --git a/bl-plugins/about/plugin.php b/bl-plugins/about/plugin.php index 82959103..35f7f051 100644 --- a/bl-plugins/about/plugin.php +++ b/bl-plugins/about/plugin.php @@ -6,8 +6,7 @@ class pluginAbout extends Plugin public function init() { $this->dbFields = array( - 'label' => 'About', - 'text' => '' + 'label' => 'About' ); } @@ -21,11 +20,6 @@ class pluginAbout extends Plugin $html .= '' . $L->get('This title is almost always used in the sidebar of the site') . ''; $html .= ''; - $html .= '
'; - $html .= ''; - $html .= ''; - $html .= '
'; - return $html; } @@ -34,7 +28,7 @@ class pluginAbout extends Plugin $html = '
'; $html .= '

' . $this->getValue('label') . '

'; $html .= '
'; - $html .= html_entity_decode(nl2br($this->getValue('text'))); + $html .= Theme::getHomepagePresentation(); $html .= '
'; $html .= '
'; diff --git a/bl-themes/defaultTheme/php/home.php b/bl-themes/defaultTheme/php/home.php index 0ae89d67..6f777d5b 100644 --- a/bl-themes/defaultTheme/php/home.php +++ b/bl-themes/defaultTheme/php/home.php @@ -1,3 +1,7 @@ + + + +
p('No pages found') ?>