-
Notifications
You must be signed in to change notification settings - Fork 136
/
Copy pathview-modern.phtml
142 lines (132 loc) · 6.14 KB
/
view-modern.phtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?php
/**
* Copyright © Magefan ([email protected]). All rights reserved.
* Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement).
*
* Glory to Ukraine! Glory to the heroes!
*/
?>
<?php
/**
* Blog post view template
*
* @var $block \Magefan\Blog\Block\Post\View
*/
?>
<?php
$_post = $block->getPost();
$_postUrl = $_post->getPostUrl();
$_postName = $block->escapeHtml($_post->getTitle(), null);
$width = (int)$block->getWidth() ?: 800;
$height = (int)$block->getHeight() ?: 500;
?>
<?= $block->getStyleViewModel()->getStyle('Magefan_Blog::css/bootstrap-4.4.1-custom-min.css') ?>
<div class="_post-view">
<div class="post-holder post-holder-<?= (int)$_post->getId() ?>">
<div class="post-header clearfix">
<!-- post category-->
<?php if ($_categoriesCount = $_post->getCategoriesCount()) { ?>
<div class="post-category mb-4">
<?php foreach ($_post->getParentCategories() as $ct) { ?>
<a class="category-name" href="<?= $block->escapeUrl($ct->getCategoryUrl()) ?>"
title="<?= $block->escapeHtml($ct->getTitle()) ?>">
<?= $block->escapeHtml($ct->getTitle()) ?>
</a>
<?php } ?>
</div>
<?php } ?>
<!-- block data -->
<div class="post-data-wrap mb-5">
<!-- post author -->
<?php if ($block->authorEnabled()) { ?>
<?php if ($_author = $_post->getAuthor()) { ?>
<span class="post-author-name">
<?php if ($block->authorPageEnabled()) { ?>
<a title="<?= $block->escapeHtml($_author->getTitle()) ?>"
href="<?= $block->escapeUrl($_author->getAuthorUrl()) ?>"><?= $block->escapeHtml($_author->getTitle()) ?>
</a>
<?php } else { ?>
<?= $block->escapeHtml($_author->getTitle()) ?>
<?php } ?>
<span>-</span>
</span>
<?php } ?>
<?php } ?>
<!-- post date -->
<?php if ($_post->isPublishDateEnabled()) { ?>
<span class="post-date"><?= $block->escapeHtml($_post->getPublishDate()) ?></span>
<?php } ?>
<!-- post view -->
<?php if ($block->viewsCountEnabled()) { ?>
<?php if ($viewsCount = $_post->getViewsCount()) { ?>
<span class="post-view float-right d-none d-md-block">
<i class="mf-blog-icon mfbi-views"></i>
<?= $block->escapeHtml($viewsCount)?>
</span>
<?php } ?>
<?php } ?>
<!-- post comments -->
<?php if ($block->magefanCommentsEnabled() && $_post->getCommentsCount()) { ?>
<span class="post-comments float-right d-none d-md-block">
<i class="mf-blog-icon mfbi-comments"></i>
<a title="<?= $block->escapeHtml($_post->getTitle()) ?>"
href="<?= $block->escapeUrl($_post->getPostUrl()) ?>#post-comments"
><?= $block->escapeHtml($_post->getCommentsCount()) ?></a>
</span>
<?php } ?>
</div>
<?php /*
<div class="post-sharing mb-4 d-none">
<!-- Go to www.addthis.com/dashboard to customize your tools -->
<div class="addthis_inline_share_toolbox text-center" addthis:url="<?= $block->escapeUrl($_postUrl) ?>"></div>
</div>
*/ ?>
</div>
<div class="post-content">
<div class="_post-description clearfix">
<!-- Post Image -->
<?php if ($featuredImage = $_post->getFeaturedImage()) { ?>
<?php
$featuredImgAlt = $_post->getData('featured_img_alt');
if (!$featuredImgAlt) {
$featuredImgAlt = $_postName;
}
?>
<div class="post-featured-image">
<img src="<?= $block->escapeUrl($featuredImage) ?>"
alt="<?= $block->escapeHtml($featuredImgAlt) ?>"
width="<?= $width ?>"
height="<?= $height ?>"
/>
</div>
<?php } ?>
<!-- Post Tags -->
<div class="post-tag">
<?php if ($_tagsCount = $_post->getTagsCount()) { ?>
<div class="item post-tags">
<div class="post-tag-title">Tags</div>
<?php $n = 0; ?>
<?php foreach ($_post->getRelatedTags() as $tag) { ?>
<?php $n++; ?>
<a title="<?= $block->escapeHtml($tag->getTitle()) ?>"
href="<?= $block->escapeUrl($tag->getTagUrl()) ?>"
><?= $block->escapeHtml($tag->getTitle()) ?></a>
<?php } ?>
</div>
<?php } ?>
</div>
<div class="post-description">
<?= /*@noEscape*/ $block->getContent() ?>
<div class="clear clearfix"></div>
</div>
</div>
</div>
<div class="post-bottom">
<div class="post-sharing-bottom mb-4">
<!-- Go to www.addthis.com/dashboard to customize your tools -->
<div class="addthis_inline_share_toolbox" addthis:url="<?= $block->escapeUrl($_postUrl) ?>"></div>
</div>
<?= $block->getChildHtml('blog.post.bottom') ?>
</div>
</div>
</div>