class AdminajaxController extends CubeIT_Controller_Admin_AdminajaxController {
+ // Make sure navigation URLs are updated when saving blog articles
+ public function saveselectlist($class, $element, $dataFilters, $reloadOnSave = false) {
+
+ $this->clearCacheTag('navigation');
+ $this->clearCacheTag('contents');
+
+ return parent::saveselectlist($class, $element, $dataFilters, $reloadOnSave);
+ }
+
}
?>
public function init() {\r
parent::init();\r
\r
+ $this->removeSubForm('intro');\r
+\r
$blog = new Fluidbook_Form_CMS_Element_BlogPosts('blog_posts');\r
$blog->setLabel('Blog Posts');\r
$this->addElement($blog);\r
->setAttrib('data-type', 'image'); // Shown when "image" content type is selected
$this->addElementLocalized($image, $compact_translations);
+ $image_caption = new Zend_Form_Element_Text('image_caption');
+ $image_caption->setLabel('Image caption')
+ ->setAttrib('data-type', 'image');
+ $this->addElementLocalized($image_caption, $compact_translations);
+
}
}
$this->addElementLocalized($title, $compact_translations);
$excerpt = new CubeIT_Form_Element_Markitup('excerpt');
- $excerpt->setLabel(__('Excerpt'));
+ $excerpt->setLabel(__('Intro Excerpt'));
$this->addElementLocalized($excerpt, $compact_translations);
- $thumbnail = new CubeIT_Form_Element_File_Image('thumbnail');
- $thumbnail->setLabel(__('Post Thumbnail'));
- $thumbnail->setMaxItems(1);
- $this->addElement($thumbnail);
+ $intro_image = new CubeIT_Form_Element_File_Image('intro_image');
+ $intro_image->setLabel(__('Intro Image'));
+ $intro_image->setMaxItems(1);
+ $this->addElement($intro_image);
+
+ $intro_text_color = new Zend_Form_Element_Select('intro_text_color');
+ $intro_text_color->setLabel('Intro Text Colour')
+ ->setMultiOptions([
+ 'light' => 'Light',
+ 'dark' => 'Dark',
+ ]);
+ $this->addElement($intro_text_color);
+
+ $intro_gradient_start = new CubeIT_Form_Element_Color('intro_gradient_start');
+ $intro_gradient_start->setLabel('Intro Gradient Start')
+ ->setValue('#0e1f31');
+ $this->addElement($intro_gradient_start);
+
+ $intro_gradient_end = new CubeIT_Form_Element_Color('intro_gradient_end');
+ $intro_gradient_end->setLabel('Intro Gradient End')
+ ->setValue('#2f5377');
+ $this->addElement($intro_gradient_end);
$content = new Fluidbook_Form_CMS_Sub_Blog_ContentBlocks();
$content->setLegend('Content Blocks');
\r
protected $title;\r
protected $excerpt;\r
- protected $thumbnail;\r
+ protected $intro_image;\r
+ protected $intro_gradient_start;\r
+ protected $intro_gradient_end;\r
+ protected $intro_text_color;\r
protected $content;\r
protected $publish_date;\r
protected $author_id;\r
$table = parent::getSchema($schema);\r
$table->addColumn('title', 'string', ['length' => 255]);\r
$table->addColumn('excerpt', 'text');\r
- $table->addColumn('thumbnail', 'text');\r
+ $table->addColumn('intro_image', 'text');\r
+ $table->addColumn('intro_gradient_start', 'string', ['length' => 7]); // Hex code\r
+ $table->addColumn('intro_gradient_end', 'string', ['length' => 7]); // Hex code\r
+ $table->addColumn('intro_text_color', 'string', ['length' => 7]); // light|dark\r
$table->addColumn('content', 'text');\r
$table->addColumn('publish_date', 'datetime');\r
$table->addColumn('author_id', 'integer', ['unsigned' => true]);\r
return $table;\r
}\r
\r
- public function getThumbnailHTML($width, $height, $class) {\r
-\r
- $this->view = Zend_Controller_Action_HelperBroker::getExistingHelper('ViewRenderer')->view;\r
-\r
- $img = $this->view->imageProcess($this->getThumbnail(), '', $width, $height, ['class' => $class]);\r
-\r
- // Fallback to other uploaded images if no thumbnail is set\r
- if (!$img) {\r
- $img = '<div class="blog-featured-image blog-featured-image-empty"></div>';\r
- }\r
-\r
- return $img;\r
- }\r
-\r
}\r
\r
$URL = CubeIT_Navigation_Page::generateAutoUri($post, Bootstrap::getBlogPostURLTemplate());\r
\r
- $img = $post->getThumbnailHTML(247, 247, 'blog-featured-image');\r
+ $img = $this->view->imageCms($post->getIntroImage(), $post->getTitle(), null, null, ['class' => 'blog-hero-image']);\r
\r
$res = $this->link($img, $URL);\r
- $res .= $this->dateTime($post->getPublishDate(), CubeIT_Date::DAY . '/' . CubeIT_Date::MONTH . '/' . CubeIT_Date::YEAR);\r
+ $res .= '<br/>';\r
+ $res .= $this->dateTime($post->getPublishDate(), CubeIT_Date::DAY .' '. CubeIT_Date::MONTH_NAME .' '. CubeIT_Date::YEAR);\r
$res .= $this->link($this->htmlElement($post->getTitle(), 'h2'), $URL, ['class' => 'news-heading-link']);\r
$res .= '<div class="acc">';\r
$res .= $this->markupDotclear($post->getExcerpt());\r
$this->headScript()->addScriptAndStyle('610-blog');
-echo $this->introBlock($this->intro, $this->blogIndex());
+echo $this->blogIndex();
echo $this->contactFooter();