diff --git a/Classes/Components/LineList.php b/Classes/Components/LineList.php index 7b6267f..82127c9 100644 --- a/Classes/Components/LineList.php +++ b/Classes/Components/LineList.php @@ -34,9 +34,11 @@ public function render(){ $contentTypeService = $this->controller->getRepository()->getContentTypeService(); $contentType = $contentTypeService->loadContentType($location->contentInfo->contentTypeId); - - $classes = $this->controller->getContainer()->getParameter('project.list.' . $contentType->identifier); - + if($this->controller->getContainer()->hasParameter('project.list.' . $contentType->identifier)){ + $classes = $this->controller->getContainer()->getParameter('project.list.' . $contentType->identifier); + } else { + return $response->setContent(''); + } $query = new Query(); $query->criterion = new LogicalAnd( diff --git a/NOTES.md b/NOTES.md index 4ac030d..f016413 100644 --- a/NOTES.md +++ b/NOTES.md @@ -1,10 +1,8 @@ TODO: - - Improve gallery template; - Improve content generation on install; - Improve pagination; - Review and improve templates; - Review and improve cache; - - Optimize code; - Release version 2.0. ######################### diff --git a/Resources/config/ezpublish.yml b/Resources/config/ezpublish.yml index 6677953..3e0263e 100644 --- a/Resources/config/ezpublish.yml +++ b/Resources/config/ezpublish.yml @@ -71,4 +71,10 @@ system: default: template: "TuteiBaseBundle:content/default:block.html.twig" match: - UrlAlias: "/" \ No newline at end of file + UrlAlias: "/" + content_view: + line: + image: + template: "TuteiBaseBundle:content/image:content_line.html.twig" + match: + Identifier\ContentType: [image] \ No newline at end of file diff --git a/Resources/views/content/article/full.html.twig b/Resources/views/content/article/full.html.twig index dd5c68a..25da754 100644 --- a/Resources/views/content/article/full.html.twig +++ b/Resources/views/content/article/full.html.twig @@ -5,30 +5,37 @@ {% set language = (siteaccess[ezpublish.siteaccess.name].language) %}
-
-
+
+

{{ ez_render_field( content, 'title', { lang: language } ) }}

- {% if content.fields.image is defined %} -
- {{ ez_render_field(content, 'image', { - parameters:{ alias:'small' }, - attr:{ class:'block_item', custom_attribute:'value' } - } - ) - }} + {% if not ez_is_field_empty( content, 'image', { lang: language } ) %} + +
+ + {{ render_hinclude( + controller( + "ez_content:viewContent", + { + "contentId": content.fields.image[language].destinationContentId, + "viewType": "line", + "params": { 'alias' : 'small' } + } + ) + ) }}
+ {% endif %} {% if not ez_is_field_empty( content, "intro" ) %} -
+
{{ ez_render_field( content, 'intro', { lang: language } ) }}
{% endif %} {% if not ez_is_field_empty( content, "body" ) %} -
+
{{ ez_render_field( content, 'body', { lang: language } ) }}
{% endif %} diff --git a/Resources/views/content/article/line.html.twig b/Resources/views/content/article/line.html.twig index 8e00010..1c227a1 100644 --- a/Resources/views/content/article/line.html.twig +++ b/Resources/views/content/article/line.html.twig @@ -10,16 +10,23 @@
- {% if content.fields.image is defined %} + {% if not ez_is_field_empty( content, 'image', { lang: language } ) %} + + {% endif %} {% if not ez_is_field_empty( content, 'intro', { lang: language } ) %} diff --git a/Resources/views/content/image/content_line.html.twig b/Resources/views/content/image/content_line.html.twig new file mode 100644 index 0000000..e1b7af2 --- /dev/null +++ b/Resources/views/content/image/content_line.html.twig @@ -0,0 +1,8 @@ +{% set language = (siteaccess[ezpublish.siteaccess.name].language) %} +{% if content.fields.image[language].uri is defined %} +{% set image_alias = ez_image_alias( content.getField('image'), content.versionInfo, alias|default('original') ) %} + +{{content.versionInfo.names[language]}} + +{% endif %} + diff --git a/Resources/views/pagelayout.html.twig b/Resources/views/pagelayout.html.twig index 1abfab2..cc37987 100644 --- a/Resources/views/pagelayout.html.twig +++ b/Resources/views/pagelayout.html.twig @@ -159,6 +159,7 @@
{% javascripts + '@eZDemoBundle/Resources/public/js/hinclude.js' "bundles/tuteibase/js/bootstrap.min.js" "bundles/tuteibase/js/lightbox-2.6.min.js" "bundles/tuteibase/js/project.js"