// URL template used for blog pages
public static function getBlogPostURLTemplate() {
- return '/blog/%title%'; // Important: must have leading slash or pages will show as not found!
+ return 'blog/%title%';
}
/* @param CubeIT_Navigation_Page_Locale $page */
$p = new CubeIT_Navigation_Page_Locale();
$p->setController('Blogpost');
- $p->setId('blog/' . $r->id);
- $p->setAutoUri($r, $URL_template);
+ $p->setId($locale .'/blog/'. $r->id);
+ $p->setAutoUri($r, $URL_template, $locale);
$p->setSitemap($online);
$p->setTitle($pageTitle);
$p->setEditable(false);
$select = new Zend_Form_Element_Select('content_type');
$select->setAttrib('data-name', 'content-type')
+ ->setLabel('Content Type')
->setMultiOptions([
'text' => 'Text Block',
'image' => 'Image',
]);
$this->addElement($select);
- $text = new CubeIT_Form_Element_Markitup_Basic('text');
+ $text = new CubeIT_Form_Element_Markitup('text');
$text->setLabel('Text Block')
->setAttrib('data-type', 'text'); // Shown when "text" content type is selected
$this->addElementLocalized($text, $compact_translations);
- $image = new CubeIT_Form_Element_File_Image('image');
- $image->setLabel('Image')
- ->setMaxItems(1)
- ->setAttrib('data-type', 'image'); // Shown when "image" content type is selected
- $this->addElementLocalized($image, $compact_translations);
$image_style = new Zend_Form_Element_Select('image_style');
$image_style->setLabel('Image Style')
'' => 'Normal',
'xl' => 'Extra Large',
]);
- $this->addElementLocalized($image_style, $compact_translations);
+ $this->addElement($image_style);
+
+ $image = new CubeIT_Form_Element_File_Image('image');
+ $image->setLabel('Image')
+ ->setMaxItems(1)
+ ->setAttrib('data-type', 'image'); // Shown when "image" content type is selected
+ $this->addElementLocalized($image, $compact_translations);
}
}
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->getThumbnail(247, 247, 'blog-featured-image');\r
-\r
- if (!$img) {\r
- $img = '<div class="blog-featured-image blog-featured-image-empty"></div>';\r
- }\r
+ $img = $post->getThumbnailHTML(247, 247, 'blog-featured-image');\r
\r
$res = $this->link($img, $URL);\r
$res .= $this->dateTime($post->getPublishDate(), CubeIT_Date::DAY . '/' . CubeIT_Date::MONTH . '/' . CubeIT_Date::YEAR);\r
<?php // TODO: blog post detail view ?>
-<pre>
+<pre style="margin-top: 200px;">
<?php print_r($this->post); ?>
</pre>
$this->headScript()->addScriptAndStyle('610-blog');
-echo $this->introBlock($this->intro, '');
-echo $this->blogIndex();
+echo $this->introBlock($this->intro, $this->blogIndex());
echo $this->contactFooter();
if (field.parents('.localized').length > 0) {
return field.parents('.localized').parent();
} else {
- return field.parents('.elementwrap').parent();
+ return field.parents('.elementwrap');
}
}
width: 100%;\r
padding:5px 5%;\r
.bar {\r
- color: #5c6268;\r
+ color: #999;\r
a.right{\r
- color:#c00;\r
+ color: #f70;\r
}\r
}\r
\r
\r
#contentWrapper .cubeit-content{\r
padding-top:120px;\r
-}
\ No newline at end of file
+}\r