default_items.php
9.55 KB
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
<?php
/**
* @package Joomla.Site
* @subpackage com_content_custom
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
$params = $this->params;
?>
<div id="archive-items">
<?php foreach ($this->items as $i => $item) : ?>
<?php $info = $item->params->get('info_block_position', 0); ?>
<div class="row<?php echo $i % 2; ?>" itemscope itemtype="https://schema.org/Article">
<div class="page-header">
<h2 itemprop="headline">
<?php if ($params->get('link_titles')) : ?>
<?php
$url = JRoute::_(ContentCustomHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language));
$url = "information/" . end(explode("/", $url));
?>
<a href="<?php echo $url; ?>" itemprop="url">
<?php echo $this->escape($item->title); ?>
</a>
<?php else : ?>
<?php echo $this->escape($item->title); ?>
<?php endif; ?>
</h2>
<?php // Content is generated by content plugin event "onContentAfterTitle" ?>
<?php echo $item->event->afterDisplayTitle; ?>
<?php if ($params->get('show_author') && !empty($item->author )) : ?>
<div class="createdby" itemprop="author" itemscope itemtype="https://schema.org/Person">
<?php $author = $item->created_by_alias ?: $item->author; ?>
<?php $author = '<span itemprop="name">' . $author . '</span>'; ?>
<?php if (!empty($item->contact_link) && $params->get('link_author') == true) : ?>
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_WRITTEN_BY', JHtml::_('link', $this->item->contact_link, $author, array('itemprop' => 'url'))); ?>
<?php else : ?>
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_WRITTEN_BY', $author); ?>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
<?php $useDefList = ($params->get('show_modify_date') || $params->get('show_publish_date') || $params->get('show_create_date')
|| $params->get('show_hits') || $params->get('show_category') || $params->get('show_parent_category')); ?>
<?php if ($useDefList && ($info == 0 || $info == 2)) : ?>
<div class="article-info muted">
<dl class="article-info">
<dt class="article-info-term">
<?php echo JText::_('COM_CONTENT_CUSTOM_ARTICLE_INFO'); ?>
</dt>
<?php if ($params->get('show_parent_category') && !empty($item->parent_slug)) : ?>
<dd>
<div class="parent-category-name">
<?php $title = $this->escape($item->parent_title); ?>
<?php if ($params->get('link_parent_category') && !empty($item->parent_slug)) : ?>
<?php $url = '<a href="' . JRoute::_(ContentCustomHelperRoute::getCategoryRoute($item->parent_slug)) . '" itemprop="genre">' . $title . '</a>'; ?>
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_PARENT', $url); ?>
<?php else : ?>
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_PARENT', '<span itemprop="genre">' . $title . '</span>'); ?>
<?php endif; ?>
</div>
</dd>
<?php endif; ?>
<?php if ($params->get('show_category')) : ?>
<dd>
<div class="category-name">
<?php $title = $this->escape($item->category_title); ?>
<?php if ($params->get('link_category') && $item->catslug) : ?>
<?php $url = '<a href="' . JRoute::_(ContentCustomHelperRoute::getCategoryRoute($item->catslug)) . '" itemprop="genre">' . $title . '</a>'; ?>
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_CATEGORY', $url); ?>
<?php else : ?>
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_CATEGORY', '<span itemprop="genre">' . $title . '</span>'); ?>
<?php endif; ?>
</div>
</dd>
<?php endif; ?>
<?php if ($params->get('show_publish_date')) : ?>
<dd>
<div class="published">
<span class="icon-calendar" aria-hidden="true"></span>
<time datetime="<?php echo JHtml::_('date', $item->publish_up, 'c'); ?>" itemprop="datePublished">
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_PUBLISHED_DATE_ON', JHtml::_('date', $item->publish_up, JText::_('DATE_FORMAT_LC3'))); ?>
</time>
</div>
</dd>
<?php endif; ?>
<?php if ($info == 0) : ?>
<?php if ($params->get('show_modify_date')) : ?>
<dd>
<div class="modified">
<span class="icon-calendar" aria-hidden="true"></span>
<time datetime="<?php echo JHtml::_('date', $item->modified, 'c'); ?>" itemprop="dateModified">
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_LAST_UPDATED', JHtml::_('date', $item->modified, JText::_('DATE_FORMAT_LC3'))); ?>
</time>
</div>
</dd>
<?php endif; ?>
<?php if ($params->get('show_create_date')) : ?>
<dd>
<div class="create">
<span class="icon-calendar" aria-hidden="true"></span>
<time datetime="<?php echo JHtml::_('date', $item->created, 'c'); ?>" itemprop="dateCreated">
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_CREATED_DATE_ON', JHtml::_('date', $item->created, JText::_('DATE_FORMAT_LC3'))); ?>
</time>
</div>
</dd>
<?php endif; ?>
<?php if ($params->get('show_hits')) : ?>
<dd>
<div class="hits">
<span class="icon-eye-open"></span>
<meta itemprop="interactionCount" content="UserPageVisits:<?php echo $item->hits; ?>" />
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_ARTICLE_HITS', $item->hits); ?>
</div>
</dd>
<?php endif; ?>
<?php endif; ?>
</dl>
</div>
<?php endif; ?>
<?php // Content is generated by content plugin event "onContentBeforeDisplay" ?>
<?php echo $item->event->beforeDisplayContent; ?>
<?php if ($params->get('show_intro')) : ?>
<div class="intro" itemprop="articleBody"> <?php echo JHtml::_('string.truncateComplex', $item->introtext, $params->get('introtext_limit')); ?> </div>
<?php endif; ?>
<?php if ($useDefList && ($info == 1 || $info == 2)) : ?>
<div class="article-info muted">
<dl class="article-info">
<dt class="article-info-term"><?php echo JText::_('COM_CONTENT_CUSTOM_ARTICLE_INFO'); ?></dt>
<?php if ($info == 1) : ?>
<?php if ($params->get('show_parent_category') && !empty($item->parent_slug)) : ?>
<dd>
<div class="parent-category-name">
<?php $title = $this->escape($item->parent_title); ?>
<?php if ($params->get('link_parent_category') && $item->parent_slug) : ?>
<?php $url = '<a href="' . JRoute::_(ContentCustomHelperRoute::getCategoryRoute($item->parent_slug)) . '" itemprop="genre">' . $title . '</a>'; ?>
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_PARENT', $url); ?>
<?php else : ?>
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_PARENT', '<span itemprop="genre">' . $title . '</span>'); ?>
<?php endif; ?>
</div>
</dd>
<?php endif; ?>
<?php if ($params->get('show_category')) : ?>
<dd>
<div class="category-name">
<?php $title = $this->escape($item->category_title); ?>
<?php if ($params->get('link_category') && $item->catslug) : ?>
<?php $url = '<a href="' . JRoute::_(ContentCustomHelperRoute::getCategoryRoute($item->catslug)) . '" itemprop="genre">' . $title . '</a>'; ?>
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_CATEGORY', $url); ?>
<?php else : ?>
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_CATEGORY', '<span itemprop="genre">' . $title . '</span>'); ?>
<?php endif; ?>
</div>
</dd>
<?php endif; ?>
<?php if ($params->get('show_publish_date')) : ?>
<dd>
<div class="published">
<span class="icon-calendar" aria-hidden="true"></span>
<time datetime="<?php echo JHtml::_('date', $item->publish_up, 'c'); ?>" itemprop="datePublished">
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_PUBLISHED_DATE_ON', JHtml::_('date', $item->publish_up, JText::_('DATE_FORMAT_LC3'))); ?>
</time>
</div>
</dd>
<?php endif; ?>
<?php endif; ?>
<?php if ($params->get('show_create_date')) : ?>
<dd>
<div class="create">
<span class="icon-calendar" aria-hidden="true"></span>
<time datetime="<?php echo JHtml::_('date', $item->created, 'c'); ?>" itemprop="dateCreated">
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_CREATED_DATE_ON', JHtml::_('date', $item->modified, JText::_('DATE_FORMAT_LC3'))); ?>
</time>
</div>
</dd>
<?php endif; ?>
<?php if ($params->get('show_modify_date')) : ?>
<dd>
<div class="modified">
<span class="icon-calendar" aria-hidden="true"></span>
<time datetime="<?php echo JHtml::_('date', $item->modified, 'c'); ?>" itemprop="dateModified">
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_LAST_UPDATED', JHtml::_('date', $item->modified, JText::_('DATE_FORMAT_LC3'))); ?>
</time>
</div>
</dd>
<?php endif; ?>
<?php if ($params->get('show_hits')) : ?>
<dd>
<div class="hits">
<span class="icon-eye-open"></span>
<meta content="UserPageVisits:<?php echo $item->hits; ?>" itemprop="interactionCount" />
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_ARTICLE_HITS', $item->hits); ?>
</div>
</dd>
<?php endif; ?>
</dl>
</div>
<?php endif; ?>
<?php // Content is generated by content plugin event "onContentAfterDisplay" ?>
<?php echo $item->event->afterDisplayContent; ?>
</div>
<?php endforeach; ?>
</div>
<div class="pagination">
<p class="counter pull-right"> <?php echo $this->pagination->getPagesCounter(); ?> </p>
<?php echo $this->pagination->getPagesLinks(); ?>
</div>