-
Notifications
You must be signed in to change notification settings - Fork 136
/
Copy pathview.phtml
71 lines (66 loc) · 2.8 KB
/
view.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
<?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();
$_postImage = $_post->getOgImage()? $_post->getOgImage() : $_post->getFeaturedImage();
$_postName = $block->escapeHtml($_post->getTitle(), null);
?>
<div class="post-view">
<div class="post-holder post-holder-<?= (int)$_post->getId() ?>">
<?php if ($block->displayAddThisToolbox()) : ?>
<div class="post-header">
<!-- Post Sharing -->
<div class="post-sharing post-sharing-top old-post-view">
<div class="share-elements">
<?php foreach ($block->getAllowedSocialNetworks() as $network) { ?>
<div class="icon-wrapper icon-<?= strtolower($network) ?>" onclick="mfShareWindowOpen('<?= $block->escapeUrl($_postUrl) ?>', '<?= strtolower($network) ?>', '<?= $_postImage ?>')">
<div class="icon" title="<?= $block->escapeHtml(__('Share on %1', $network == 'Twitter' ? "X" : $network)) ?>">
<img src="<?= $this->getViewFileUrl('Magefan_Blog::images/social/' . strtolower($network) . '.svg') ?>" alt="<?= $block->escapeHtml(__('Share on %1', $network == 'Twitter' ? "X" : $network)) ?>">
</div>
</div>
<?php } ?>
</div>
</div>
<!-- END Post Sharing -->
<?= $block->getInfoHtml() ?>
</div>
<?php endif; ?>
<div class="post-content">
<div class="post-description clearfix">
<?php if ($featuredImage = $_post->getFeaturedImage()) { ?>
<?php
$featuredImgAlt = $_post->getData('featured_img_alt');
if (!$featuredImgAlt) {
$featuredImgAlt = $_postName;
}
?>
<div class="post-ftimg-hld">
<img src="<?= $block->escapeUrl($featuredImage) ?>"
alt="<?= $block->escapeHtml($featuredImgAlt) ?>" />
</div>
<?php } ?>
<div class="post-text-hld">
<?= /*@noEscape*/ $block->getContent() ?>
<div class="clear clearfix"></div>
</div>
</div>
</div>
<div class="post-bottom">
<?= $block->getChildHtml('blog.post.bottom') ?>
</div>
</div>
</div>