Revision | 43 (tree) |
---|---|
Time | 2020-05-24 10:15:06 |
Author | derekwildstar |
Zost.bsdesign e styles.css
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Ajustes no estilo para remover a sombra de ícones colocados dentro de elementos <button>
com_content/featured/default.php
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Incluído código para obter informações globais compartilhadas por cada um dos artigos em destaque
O objeto que representa cada artigo em destaque é acrescido com informações adicionais (globais) por meio da inclusão de uma nova propriedade chamada zost. Pretendo utilizar esta mesma técnica no futuro para encaminha informações
com_content/featured/default_item.php
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Ajustes em quebras de linhas finais nos layouts importados
Adicionado botão "ler mais"
Adicionado o resultado do evento "afterDisplayContent"
Adicionado o separador de artigos em destaque, um svg com um arabesco bonitinho :)
layouts/joomla/content/info_block.php
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Removida codificação que tinha intenção de obter código global
layouts/joomla/content/info_block/author.php
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Removido código obsoleto
layouts/joomla/content/info_block/create_date.php
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Removido código obsoleto
layouts/joomla/content/info_block/hits.php
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Removido código obsoleto
layouts/joomla/content/info_block/modify_date.php
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Removido código obsoleto
layouts/joomla/content/info_block/publish_date.php
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Removido código obsoleto
layouts/joomla/content/tags.php
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Ajustado o fim do bloco (removida a quebra de linha dentro do bloco "heredoc")
layouts/joomla/content/readmore.php
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Adicionado arquivo de layout do botão "leia mais"
@@ -554,6 +554,10 @@ | ||
554 | 554 | filter: drop-shadow(0 0 1px #000000) drop-shadow(0 0 2px #000000); |
555 | 555 | } |
556 | 556 | |
557 | +button > svg.icon { | |
558 | + filter: initial; | |
559 | +} | |
560 | + | |
557 | 561 | use.icon { |
558 | 562 | fill: var(--text-color); |
559 | 563 | } |
@@ -5,12 +5,12 @@ | ||
5 | 5 | em destaque (featured). |
6 | 6 | Detalhes: Ao clicar em um ítem de menu do tipo "Featured Articles", este script |
7 | 7 | é executado. Algumas opções vistas aqui pertencem ao item de menu, ou |
8 | - seja, é o item de menu que configura aquilo que será renderizado. Caso | |
9 | - algo não faça sentido veja no Joomla o menu de nome "Inicio". Muitas | |
10 | - opções foram removidas, já que este template está sendo construído | |
11 | - para ser simples e direcionado ao site ZOST. Para ver outras opções | |
12 | - veja o arquivo original | |
13 | - (/portal/components/com_content/views/featured/tmpl/default.php) | |
8 | + seja, é o item de menu que configura aquilo que será renderizado. Caso | |
9 | + algo não faça sentido veja no Joomla o menu de nome "Inicio". Muitas | |
10 | + opções foram removidas, já que este template está sendo construído | |
11 | + para ser simples e direcionado ao site ZOST. Para ver outras opções | |
12 | + veja o arquivo original | |
13 | + (/portal/components/com_content/views/featured/tmpl/default.php) | |
14 | 14 | |
15 | 15 | Variáveis definidas por padrão: |
16 | 16 | > $this (ContentViewFeatured) |
@@ -32,7 +32,7 @@ | ||
32 | 32 | $pageCounter = $this->params->def('show_pagination_results', 1) ? trim($this->pagination->getPagesCounter()) . "\n" : null; |
33 | 33 | $pageLinks = $this->pagination->getPagesLinks(); |
34 | 34 | $pageLinks = Helpers::indentLines($pageLinks,1); |
35 | - | |
35 | + | |
36 | 36 | echo <<<EOH |
37 | 37 | <div class="pagination top"> |
38 | 38 | $pageCounter$pageLinks |
@@ -41,13 +41,44 @@ | ||
41 | 41 | EOH; |
42 | 42 | } |
43 | 43 | |
44 | +$ogImageUrl = Helpers::getOGImage(); | |
45 | +$ogImageWidth = 0; | |
46 | +$ogImageHeight = 0; | |
47 | + | |
48 | +if ($ogImageUrl && ($ogImageInfo = getimagesize($ogImageUrl))) { | |
49 | + $ogImageWidth = $ogImageInfo[0]; | |
50 | + $ogImageHeight = $ogImageInfo[1]; | |
51 | +} | |
52 | + | |
53 | +$textDirection = JFactory::getLanguage()->isRtl() ? "left" : "right"; | |
54 | + | |
55 | +$zostHelpers = Helpers::getHelpers(); | |
56 | + | |
44 | 57 | if (!empty($this->lead_items)) { |
45 | 58 | foreach ($this->lead_items as $index=>&$item) { |
46 | 59 | $unpublished = $item->state == 0 || strtotime($item->publish_up) > strtotime(JFactory::getDate()) || ((strtotime($item->publish_down) < strtotime(JFactory::getDate())) && $item->publish_down != $this->db->getNullDate()) ? " unpublished" : null; |
60 | + // Carrega o atriburo item da classe atual com a referência a um dos | |
61 | + // itens iterados (itens de lead_items). A cada iteração este atributo | |
62 | + // apontará para o item a ser renderizado. Quando se chama loadTemplate | |
63 | + // este atributo é lido e usado dentro do template para renderizar o | |
64 | + // item | |
47 | 65 | $this->item = &$item; |
48 | - $itemContents = $this->loadTemplate('item'); // carregar default_item.php | |
66 | + // O PHP permite que se incluam atributos em suas classes dinamicamente! | |
67 | + // Aqui estamos passando algumas informações que são obtidas apenas uma | |
68 | + // vez e compartilhadas por todos os itens sendo renderizados | |
69 | + $this->item->zost = new stdClass(); | |
70 | + $this->item->zost->menu = $zostHelpers->app->getMenu(); | |
71 | + $this->item->zost->textDirection = $textDirection; | |
72 | + $this->item->zost->siteName = $zostHelpers->cnf->get("sitename"); | |
73 | + $this->item->zost->baseSiteUrl = Helpers::baseSite(); | |
74 | + $this->item->zost->templateHref = Helpers::baseSite(true) . "/templates/" . $zostHelpers->app->getTemplate(); | |
75 | + $this->item->zost->ogImageUrl = $ogImageUrl; | |
76 | + $this->item->zost->ogImageWidth = $ogImageWidth; | |
77 | + $this->item->zost->ogImageHeight = $ogImageHeight; | |
78 | + | |
79 | + $itemContents = $this->loadTemplate("item"); // carregar default_item.php | |
49 | 80 | $itemContents = Helpers::indentLines($itemContents,1); |
50 | - | |
81 | + | |
51 | 82 | // itemscope define um escopo microdata. itemtype define o tipo de |
52 | 83 | // microdata que será representado. Mais informações em |
53 | 84 | // https://schema.org/docs/documents.html |
@@ -63,7 +94,7 @@ | ||
63 | 94 | if (!empty($this->link_items)) { |
64 | 95 | $itemContents = $this->loadTemplate('links'); // carregar default_links.php |
65 | 96 | $itemContents = Helpers::indentLines($itemContents,1); |
66 | - | |
97 | + | |
67 | 98 | echo <<<EOH |
68 | 99 | <div class="links"> |
69 | 100 | $itemContents |
@@ -76,7 +107,7 @@ | ||
76 | 107 | $pageCounter = $this->params->def('show_pagination_results', 1) ? trim($this->pagination->getPagesCounter()) . "\n" : null; |
77 | 108 | $pageLinks = $this->pagination->getPagesLinks(); |
78 | 109 | $pageLinks = Helpers::indentLines($pageLinks,1); |
79 | - | |
110 | + | |
80 | 111 | echo <<<EOH |
81 | 112 | <div class="pagination"> |
82 | 113 | $pageCounter$pageLinks |
@@ -21,7 +21,7 @@ | ||
21 | 21 | defined('_JEXEC') or die('Restricted access'); |
22 | 22 | |
23 | 23 | $params = &$this->item->params; |
24 | -$info = $this->item->params->get("info_block_position", 0); | |
24 | +$info = $params->get("info_block_position", 0); | |
25 | 25 | |
26 | 26 | $articleUrl = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language)); |
27 | 27 |
@@ -46,7 +46,7 @@ | ||
46 | 46 | if ((strtotime($this->item->publish_down) < strtotime(JFactory::getDate())) && $this->item->publish_down != $this->db->getNullDate()) { |
47 | 47 | $state[] = JText::_("JEXPIRED"); |
48 | 48 | } |
49 | - | |
49 | + | |
50 | 50 | if (isset($state) && count($state) > 0) { |
51 | 51 | $state = implode(" | ",$state); |
52 | 52 | echo <<<EOH |
@@ -130,59 +130,26 @@ | ||
130 | 130 | // queira entender melhor, olhe info_block.php original e este arquivo |
131 | 131 | // (default_item.php) original. Incluí também um parâmetro adicional, que será |
132 | 132 | // acessível em info_block.php! |
133 | -echo(JLayoutHelper::render('joomla.content.info_block', array("item" => $this->item, "params" => $params, "position" => 'above', "articleUrl" => $articleUrl))); | |
133 | +echo(JLayoutHelper::render("joomla.content.info_block", array("item" => $this->item, "params" => $params, "position" => "above", "articleUrl" => $articleUrl)) . "\n"); | |
134 | 134 | |
135 | -echo(JLayoutHelper::render('joomla.content.tags', $this->item->tags->itemTags)); | |
135 | +echo(JLayoutHelper::render("joomla.content.tags", $this->item->tags->itemTags) . "\n"); | |
136 | 136 | |
137 | -echo($this->item->introtext); | |
137 | +echo(trim($this->item->introtext) . "\n"); | |
138 | 138 | |
139 | -echo("<img src=\"/portal/templates/zost_basicblack/assets/img/OrnamentalTextDivisor.svg\" style=\"height: 1.8rem\">"); | |
140 | -?> | |
139 | +if ($params->get('access-view')) { | |
140 | + $link = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language)); | |
141 | +} else { | |
142 | + $menu = $this->item->zost->menu; | |
143 | + $active = $menu->getActive(); | |
144 | + $itemId = $active->id; | |
145 | + $link = new JUri(JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId, false)); | |
146 | + $link->setVar('return', base64_encode(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language))); | |
147 | +} | |
141 | 148 | |
149 | +echo(JLayoutHelper::render('joomla.content.readmore', array('item' => $this->item, 'params' => $params, 'link' => $link)) . "\n"); | |
142 | 150 | |
143 | -<!-- ========================= | |
151 | +echo($this->item->event->afterDisplayContent); | |
144 | 152 | |
153 | +echo("<img src=\"/portal/templates/zost_basicblack/assets/img/OrnamentalTextDivisor.svg\" style=\"height: 1.8rem\">"); | |
145 | 154 | |
146 | - | |
147 | - | |
148 | - | |
149 | - | |
150 | - | |
151 | -<?php // Todo Not that elegant would be nice to group the params ?> | |
152 | -<?php $useDefList = ($params->get('show_modify_date') || $params->get('show_publish_date') || $params->get('show_create_date') | |
153 | - || $params->get('show_hits') || $params->get('show_category') || $params->get('show_parent_category') || $params->get('show_author')); ?> | |
154 | - | |
155 | - | |
156 | - | |
157 | - | |
158 | - | |
159 | -<?php if ($info == 1 || $info == 2) : ?> | |
160 | - <?php if ($useDefList) : ?> | |
161 | - <?php // Todo: for Joomla4 joomla.content.info_block.block can be changed to joomla.content.info_block ?> | |
162 | - <?php echo JLayoutHelper::render('joomla.content.info_block.block', array('item' => $this->item, 'params' => $params, 'position' => 'below')); ?> | |
163 | - <?php endif; ?> | |
164 | - <?php if ($params->get('show_tags', 1) && !empty($this->item->tags->itemTags)) : ?> | |
165 | - <?php echo JLayoutHelper::render('joomla.content.tags', $this->item->tags->itemTags); ?> | |
166 | - <?php endif; ?> | |
167 | -<?php endif; ?> | |
168 | - | |
169 | -<?php if ($params->get('show_readmore') && $this->item->readmore) : | |
170 | - if ($params->get('access-view')) : | |
171 | - $link = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language)); | |
172 | - else : | |
173 | - $menu = JFactory::getApplication()->getMenu(); | |
174 | - $active = $menu->getActive(); | |
175 | - $itemId = $active->id; | |
176 | - $link = new JUri(JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId, false)); | |
177 | - $link->setVar('return', base64_encode(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language))); | |
178 | - endif; ?> | |
179 | - | |
180 | - <?php echo JLayoutHelper::render('joomla.content.readmore', array('item' => $this->item, 'params' => $params, 'link' => $link)); ?> | |
181 | - | |
182 | -<?php endif; ?> | |
183 | - | |
184 | - | |
185 | -<?php // Content is generated by content plugin event "onContentAfterDisplay" ?> | |
186 | -<?php echo $this->item->event->afterDisplayContent; ?> | |
187 | - | |
188 | -============================= --> | |
155 | +?> | |
\ No newline at end of file |
@@ -23,7 +23,6 @@ | ||
23 | 23 | |
24 | 24 | $item = $displayData["item"]; |
25 | 25 | $params = $displayData["params"]; |
26 | -$templateHref = $displayData["templatehref"]; | |
27 | 26 | |
28 | 27 | $author = ($item->created_by_alias ? "" : $item->author); |
29 | 28 | $author = "<span itemprop=\"name\">$author</span>"; |
@@ -34,4 +33,4 @@ | ||
34 | 33 | $author = JText::sprintf('COM_CONTENT_WRITTEN_BY', $author); |
35 | 34 | } |
36 | 35 | ?> |
37 | -<svg viewBox="0 0 8 8" class="icon" style="height: 1rem; margin-top: -3px"><use style="fill: #FFF" xlink:href="<?php echo($templateHref); ?>/assets/img/open-iconic.min.svg#copywriting"></use></svg> <?php echo($author); ?> | |
\ No newline at end of file | ||
36 | +<svg viewBox="0 0 8 8" class="icon" style="height: 1rem; margin-top: -3px"><use style="fill: #FFF" xlink:href="<?php echo($item->zost->templateHref); ?>/assets/img/open-iconic.min.svg#copywriting"></use></svg> <?php echo($author); ?> | |
\ No newline at end of file |
@@ -24,9 +24,8 @@ | ||
24 | 24 | |
25 | 25 | $item = $displayData["item"]; |
26 | 26 | $params = $displayData["params"]; |
27 | -$templateHref = $displayData["templatehref"]; | |
28 | 27 | |
29 | 28 | $date1 = JHtml::_('date', $item->created, 'c'); |
30 | 29 | $date2 = JHtml::_('date', $item->created, "l, j \d\\e F \d\\e Y à\s H:i"); |
31 | 30 | ?> |
32 | -<svg viewBox="0 0 8 8" class="icon" style="height: 1rem; margin-top: -3px"><use style="fill: #FFF" xlink:href="<?php echo($templateHref); ?>/assets/img/open-iconic.min.svg#calendar"></use></svg> <time datetime="<?php echo($date1) ?>" itemprop="dateCreated"><?php echo(JText::sprintf('COM_CONTENT_CREATED_DATE_ON', $date2)); ?></time> | |
\ No newline at end of file | ||
31 | +<svg viewBox="0 0 8 8" class="icon" style="height: 1rem; margin-top: -3px"><use style="fill: #FFF" xlink:href="<?php echo($item->zost->templateHref); ?>/assets/img/open-iconic.min.svg#calendar"></use></svg> <time datetime="<?php echo($date1) ?>" itemprop="dateCreated"><?php echo(JText::sprintf('COM_CONTENT_CREATED_DATE_ON', $date2)); ?></time> | |
\ No newline at end of file |
@@ -24,7 +24,6 @@ | ||
24 | 24 | |
25 | 25 | $item = $displayData["item"]; |
26 | 26 | $params = $displayData["params"]; |
27 | -$templateHref = $displayData["templatehref"]; | |
28 | 27 | |
29 | 28 | $hits = $item->hits; |
30 | 29 | $hits = "<span itemprop=\"userInteractionCount\">$hits</span>"; |
@@ -24,9 +24,8 @@ | ||
24 | 24 | |
25 | 25 | $item = $displayData["item"]; |
26 | 26 | $params = $displayData["params"]; |
27 | -$templateHref = $displayData["templatehref"]; | |
28 | 27 | |
29 | 28 | $date1 = JHtml::_('date', $item->modified, 'c'); |
30 | 29 | $date2 = JHtml::_('date', $item->modified, "l, j \d\\e F \d\\e Y à\s H:i"); |
31 | 30 | ?> |
32 | -<svg viewBox="0 0 8 8" class="icon" style="height: 1rem; margin-top: -3px"><use style="fill: #FFF" xlink:href="<?php echo($templateHref); ?>/assets/img/open-iconic.min.svg#calendar"></use></svg> <time datetime="<?php echo($date1) ?>" itemprop="dateModified"><?php echo(JText::sprintf('COM_CONTENT_LAST_UPDATED', $date2)); ?></time> | |
\ No newline at end of file | ||
31 | +<svg viewBox="0 0 8 8" class="icon" style="height: 1rem; margin-top: -3px"><use style="fill: #FFF" xlink:href="<?php echo($item->zost->templateHref); ?>/assets/img/open-iconic.min.svg#calendar"></use></svg> <time datetime="<?php echo($date1) ?>" itemprop="dateModified"><?php echo(JText::sprintf('COM_CONTENT_LAST_UPDATED', $date2)); ?></time> | |
\ No newline at end of file |
@@ -24,9 +24,8 @@ | ||
24 | 24 | |
25 | 25 | $item = $displayData["item"]; |
26 | 26 | $params = $displayData["params"]; |
27 | -$templateHref = $displayData["templatehref"]; | |
28 | 27 | |
29 | 28 | $date1 = JHtml::_('date', $item->publish_up, 'c'); |
30 | 29 | $date2 = JHtml::_('date', $item->publish_up, "l, j \d\\e F \d\\e Y à\s H:i"); |
31 | 30 | ?> |
32 | -<svg viewBox="0 0 8 8" class="icon" style="height: 1rem; margin-top: -3px"><use style="fill: #FFF" xlink:href="<?php echo($templateHref); ?>/assets/img/open-iconic.min.svg#calendar"></use></svg> <time datetime="<?php echo($date1) ?>" itemprop="datePublished"><?php echo(JText::sprintf('COM_CONTENT_PUBLISHED_DATE_ON', $date2)); ?></time> | |
\ No newline at end of file | ||
31 | +<svg viewBox="0 0 8 8" class="icon" style="height: 1rem; margin-top: -3px"><use style="fill: #FFF" xlink:href="<?php echo($item->zost->templateHref); ?>/assets/img/open-iconic.min.svg#calendar"></use></svg> <time datetime="<?php echo($date1) ?>" itemprop="datePublished"><?php echo(JText::sprintf('COM_CONTENT_PUBLISHED_DATE_ON', $date2)); ?></time> | |
\ No newline at end of file |
@@ -42,13 +42,6 @@ | ||
42 | 42 | $articleUrl = $displayData["articleUrl"]; |
43 | 43 | $infoBlockPosition = $params->get("info_block_position", 0); |
44 | 44 | |
45 | -use Zost\Helpers; | |
46 | - | |
47 | -$zostHelpers = Helpers::getHelpers(); | |
48 | -// Coloca mais um parâmetro em displayData, o qual será utilizado em alguns | |
49 | -// sublayouts | |
50 | -$displayData["templatehref"] = Helpers::baseSite(true) . "/templates/" . $zostHelpers->app->getTemplate(); | |
51 | - | |
52 | 45 | $icons = array(); |
53 | 46 | |
54 | 47 | // Renderiza ícones usando layouts contidos em joomla/content/icons. icon = nome |
@@ -69,17 +62,8 @@ | ||
69 | 62 | $icons[] = JHtml::_('icon.edit', $item, $params, array(), true); |
70 | 63 | } |
71 | 64 | |
72 | -$publisherLogo = Helpers::getOGImage(); | |
73 | - | |
74 | -echo("obtenha o tamanho da imagem apenas uma vez! fora do loop"); | |
75 | -/* | |
76 | -if ($publisherLogo && ($publisherLogoInfo = getimagesize($publisherLogo))) { | |
77 | - $publisherLogoWidth = $publisherLogoInfo[0]; | |
78 | - $publisherLogoHeight = $publisherLogoInfo[1]; | |
79 | -} | |
80 | -*/ | |
81 | 65 | if ($item->images) { |
82 | - $articleImage = $zostHelpers->baseSite() . json_decode($item->images)->image_fulltext; | |
66 | + $articleImage = $item->zost->baseSiteUrl . json_decode($item->images)->image_fulltext; | |
83 | 67 | } |
84 | 68 | ?> |
85 | 69 | <table class="article-info"> |
@@ -103,10 +87,10 @@ | ||
103 | 87 | <meta itemprop="image" content="<?php echo($articleImage); ?>" /> |
104 | 88 | <meta itemprop="mainEntityOfPage" content="<?php echo($articleUrl); ?>" /> |
105 | 89 | <div itemprop="publisher" itemscope itemtype="https://schema.org/Organization"> |
106 | - <meta itemprop="name" content="<?php echo($zostHelpers->cnf->get("sitename")); ?>" /> | |
90 | + <meta itemprop="name" content="<?php echo($item->zost->siteName); ?>" /> | |
107 | 91 | <div itemprop="logo" itemscope itemtype="https://schema.org/ImageObject"> |
108 | - <meta itemprop="url" content="<?php echo($publisherLogo); ?>" /> | |
109 | - <meta itemprop="width" content="<?php echo($publisherLogoWidth); ?>" /> | |
110 | - <meta itemprop="height" content="<?php echo($publisherLogoHeight); ?>" /> | |
92 | + <meta itemprop="url" content="<?php echo($item->zost->ogImageUrl); ?>" /> | |
93 | + <meta itemprop="width" content="<?php echo($item->zost->ogImageWidth); ?>" /> | |
94 | + <meta itemprop="height" content="<?php echo($item->zost->ogImageHeight); ?>" /> | |
111 | 95 | </div> |
112 | -</div> | |
96 | +</div> | |
\ No newline at end of file |
@@ -0,0 +1,56 @@ | ||
1 | +<?php | |
2 | +/******************************************************************************* | |
3 | +Nome: layouts/joomla/content/readmore.php | |
4 | +Descrição: Script responsável por renderizar o botão "leia mais...", normalmente | |
5 | + colocado abaixo de cada introdução de artigo na tela de artigos em | |
6 | + destaque | |
7 | +Detalhes: O conteúdo da variável displayData é passado como segundo parâmetro | |
8 | + para a função JLayoutHelper::render na forma de um array associativo. | |
9 | + Arquivos de layout como este são renderizados por esta função, | |
10 | + portanto tudo que precisar ser acessado aqui deve ser passado no array | |
11 | + associativo (segundo parâmetro) da função JLayoutHelper::render. | |
12 | + Conclui-se que este arquivo só é processado por meio desta função, a | |
13 | + qual deve ter sido chamada em algum lugar | |
14 | + | |
15 | +Variáveis definidas por padrão: | |
16 | +> $this (Joomla\CMS\Layout\FileLayout) | |
17 | +> $displayData | |
18 | +> $layoutOutput | |
19 | +> $path | |
20 | +> Variáveis definidas nos requires imediatos | |
21 | + | |
22 | +Use get_included_files() e get_defined_vars() para obter informações importantes | |
23 | +*******************************************************************************/ | |
24 | +defined('_JEXEC') or die('Restricted access'); | |
25 | + | |
26 | +$params = $displayData["params"]; | |
27 | +$item = $displayData["item"]; | |
28 | + | |
29 | +$buttonLink = $displayData["link"]; | |
30 | +$buttonCaption = null; | |
31 | +$buttonTitle = null; | |
32 | + | |
33 | +if (!$params->get('access-view')) { | |
34 | + $buttonTitle = JText::_('COM_CONTENT_REGISTER_TO_READ_MORE') . " " . htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8'); | |
35 | + $buttonCaption = JText::_('COM_CONTENT_REGISTER_TO_READ_MORE'); | |
36 | +} else if ($readmore = $item->alternative_readmore) { | |
37 | + $buttonTitle = htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8'); | |
38 | + $buttonCaption = $readmore; | |
39 | + | |
40 | + if ($params->get('show_readmore_title', 0) != 0) { | |
41 | + $buttonCaption .= JHtml::_('string.truncate', $item->title, $params->get('readmore_limit')); | |
42 | + } | |
43 | +} else if ($params->get('show_readmore_title', 0) == 0) { | |
44 | + $buttonTitle = JText::_('COM_CONTENT_READ_MORE') . " ". htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8'); | |
45 | + $buttonCaption = JText::sprintf('COM_CONTENT_READ_MORE_TITLE'); | |
46 | +} else { | |
47 | + $buttonTitle = JText::_('COM_CONTENT_READ_MORE'). " ". htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8'); | |
48 | + $buttonCaption = JText::_('COM_CONTENT_READ_MORE') . " ". JHtml::_('string.truncate', $item->title, $params->get('readmore_limit')); | |
49 | +} | |
50 | +?> | |
51 | +<form action="<?php echo($buttonLink); ?>" method="GET"> | |
52 | + <meta itemprop="url" content="<?php echo($buttonLink); ?>" /> | |
53 | + <div class="form-group" style="text-align: center; margin-bottom: 1rem"> | |
54 | + <button class="btn btn-primary btn-sm" type="submit" title="<?php echo($buttonTitle); ?>"><?php echo($buttonCaption); ?> <svg viewBox="0 0 8 8" class="icon" style="height: 1rem;"><use style="fill: #fff" xlink:href="/portal/templates/zost_basicblack/assets/img/open-iconic.min.svg#chevron-<?php echo($item->zost->textDirection); ?>"></use></svg></button> | |
55 | + </div> | |
56 | +</form> | |
\ No newline at end of file |
@@ -54,7 +54,6 @@ | ||
54 | 54 | echo <<<EOH |
55 | 55 | </ul> |
56 | 56 | <meta itemprop="keywords" content="$keywords" /> |
57 | - | |
58 | 57 | EOH; |
59 | 58 | } |
60 | -?> | |
59 | +?> | |
\ No newline at end of file |