File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,7 +58,8 @@ public function show(string $path = ''): Response
5858 'layout ' => $ pageAsset ->layout ?? null ,
5959 'page ' => $ pageAsset ->page ?? null ,
6060 'containers ' => $ pageAsset ->containers ?? [],
61- 'navigation ' => $ navigation
61+ 'navigation ' => $ navigation ,
62+ 'dotcms_host ' => $ _ENV ['DOTCMS_HOST ' ] ?? 'https://demo.dotcms.com '
6263 ]);
6364 } catch (HttpException $ e ) {
6465 // Map HTTP errors to appropriate Symfony exceptions
Original file line number Diff line number Diff line change 11{% extends ' base.html.twig' %}
22
3- {% block title %}{{ pageAsset .page .title | default (' Blog Post' ) }}{% endblock %}
4-
53{% block body %}
64 {% include ' dotcms/header.twig' %}
75
86 <div class =" container" >
97 <div class =" row" >
108 <div class =" col-start-1 col-end-13" >
119 <article >
12- <h1 >{{ pageAsset .page .title }}</h1 >
13-
14- {% if pageAsset .urlContentMap .blogContent is defined %}
15- <div class =" blog-content" >
16- {{ renderBlockEditorField(pageAsset .urlContentMap .blogContent ) }}
17- </div >
10+ {% if pageAsset .urlContentMap .image is defined %}
11+ {% set imageHtml %}
12+ <figure style =" margin-bottom: 2rem" >
13+ <img src =" {{ dotcms_host }}/dA/{{ pageAsset .urlContentMap .identifier }}/image"
14+ alt =" {{ pageAsset .urlContentMap .title | default (' ' )| e (' html_attr' ) }}"
15+ style =" width:100%;max-height:500px;object-fit:cover;" >
16+ </figure >
17+ {% endset %}
18+ {{ imageHtml | raw }}
1819 {% endif %}
20+
21+ <div style =" max-width: 70ch; margin: 0 auto;" >
22+
23+ <header >
24+ <h1 >{{ pageAsset .urlContentMap .title }}</h1 >
25+ {% if pageAsset .urlContentMap .publishDate is defined %}
26+ {% set publishDate = pageAsset .urlContentMap .publishDate // 1000 %}
27+ <time datetime =" {{ publishDate | date (' c' ) }}" class =" blog-publish-date" >
28+ Published on {{ publishDate | date (' F j, Y' ) }}
29+ </time >
30+ {% endif %}
31+ </header >
32+
33+ <hr />
34+
35+ {% if pageAsset .urlContentMap .blogContent is defined %}
36+ <div class =" blog-content" >
37+ {{ renderBlockEditorField(pageAsset .urlContentMap .blogContent ) }}
38+ </div >
39+ {% endif %}
40+
41+ </div >
1942 </article >
2043 </div >
2144 </div >
You can’t perform that action at this time.
0 commit comments