✨ Add global homepage presentation support
This commit is contained in:
parent
5b9b7bea85
commit
a1f3a06164
5 changed files with 36 additions and 8 deletions
|
@ -74,6 +74,16 @@ echo Bootstrap::formInputHidden(array(
|
||||||
'tip' => $L->g('you-can-add-a-site-description-to-provide')
|
'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(
|
echo Bootstrap::formInputText(array(
|
||||||
'name' => 'footer',
|
'name' => 'footer',
|
||||||
'label' => $L->g('Footer text'),
|
'label' => $L->g('Footer text'),
|
||||||
|
|
|
@ -411,6 +411,20 @@ class Theme
|
||||||
return $FONTAWESOME;
|
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 = '')
|
public static function jsSortable($attributes = '')
|
||||||
{
|
{
|
||||||
// https://github.com/psfpro/bootstrap-html5sortable
|
// https://github.com/psfpro/bootstrap-html5sortable
|
||||||
|
|
|
@ -6,6 +6,7 @@ class Site extends dbJSON
|
||||||
'title' => 'I am Guybrush Threepwood, mighty developer',
|
'title' => 'I am Guybrush Threepwood, mighty developer',
|
||||||
'slogan' => '',
|
'slogan' => '',
|
||||||
'description' => '',
|
'description' => '',
|
||||||
|
'homepagePresentation' => '',
|
||||||
'footer' => 'I wanna be a pirate!',
|
'footer' => 'I wanna be a pirate!',
|
||||||
'itemsPerPage' => 6,
|
'itemsPerPage' => 6,
|
||||||
'language' => 'en',
|
'language' => 'en',
|
||||||
|
@ -282,6 +283,11 @@ class Site extends dbJSON
|
||||||
return $this->getField('description');
|
return $this->getField('description');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function homepagePresentation()
|
||||||
|
{
|
||||||
|
return $this->getField('homepagePresentation');
|
||||||
|
}
|
||||||
|
|
||||||
public function emailFrom()
|
public function emailFrom()
|
||||||
{
|
{
|
||||||
return $this->getField('emailFrom');
|
return $this->getField('emailFrom');
|
||||||
|
|
|
@ -6,8 +6,7 @@ class pluginAbout extends Plugin
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
$this->dbFields = array(
|
$this->dbFields = array(
|
||||||
'label' => 'About',
|
'label' => 'About'
|
||||||
'text' => ''
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,11 +20,6 @@ class pluginAbout extends Plugin
|
||||||
$html .= '<span class="tip">' . $L->get('This title is almost always used in the sidebar of the site') . '</span>';
|
$html .= '<span class="tip">' . $L->get('This title is almost always used in the sidebar of the site') . '</span>';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
$html .= '<div>';
|
|
||||||
$html .= '<label>' . $L->get('About') . '</label>';
|
|
||||||
$html .= '<textarea name="text" id="jstext">' . $this->getValue('text') . '</textarea>';
|
|
||||||
$html .= '</div>';
|
|
||||||
|
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +28,7 @@ class pluginAbout extends Plugin
|
||||||
$html = '<div class="plugin plugin-about">';
|
$html = '<div class="plugin plugin-about">';
|
||||||
$html .= '<h2 class="plugin-label">' . $this->getValue('label') . '</h2>';
|
$html .= '<h2 class="plugin-label">' . $this->getValue('label') . '</h2>';
|
||||||
$html .= '<div class="plugin-content">';
|
$html .= '<div class="plugin-content">';
|
||||||
$html .= html_entity_decode(nl2br($this->getValue('text')));
|
$html .= Theme::getHomepagePresentation();
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
<?php if ($WHERE_AM_I == 'home') : ?>
|
||||||
|
<?php echo Theme::getHomepagePresentation(); ?>
|
||||||
|
<?php endif ?>
|
||||||
|
|
||||||
<?php if (empty($content)) : ?>
|
<?php if (empty($content)) : ?>
|
||||||
<div>
|
<div>
|
||||||
<?php $language->p('No pages found') ?>
|
<?php $language->p('No pages found') ?>
|
||||||
|
|
Loading…
Add table
Reference in a new issue