Wysłane przez
-=Darecki=-
Szukać tego przez zaplecze czy przez ftp bezpośrednio w plikach źródłowych joomli?
Wysłane przez
siristru
Wtedy trzeba tak zmodyfikować widok listy artykułów w by wprowadzić warunek: jeśli pole łącze jest wypełnione to przycisk i tytuł maja ten link.
To nieco wyższa szkoła jazdy i wymaga modyfikowania plików widoku.
https://wiki.joomla.pl/Jak_nadpisywa...h_widok%C3%B3w
https://wiki.joomla.pl/Zrozumie%C4%8...ania_szablonem
Dla artykułów wyróżnionych
Plik widoku kopiujesz tu:
ROOT/templates/<twoj-szablon>/html/com_content/featured/default_item.php
ROOT/templates/<twoj-szablon>/html/com_content/featured/default.php
z
ROOT/components/com_content/views/featured/tmpl
Modyfikujesz plik: ROOT/templates/<twoj-szablon>/html/com_content/featured/default_item.php
W moim przypadku jest tak:
Kod PHP:
<?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
// Create a shortcut for params.
$params = &$this->item->params;
$images = json_decode($this->item->images);
$urls = json_decode($this->item->urls);
$canEdit = $this->item->params->get('access-edit');
$info = $this->item->params->get('info_block_position', 0);
if($urls->targetc == 1) {$linkTarget = 'target="_blank"';};
// Check if associations are implemented. If they are, define the parameter.
$assocParam = (JLanguageAssociations::isEnabled() && $params->get('show_associations'));
?>
<div class="item-content-inner">
<?php if (isset($images->image_intro) && !empty($images->image_intro)) : ?>
<img src="<?php echo $images->image_intro; ?>" />
<?php endif; ?>
<?php if(!empty($this->item->introtext)) { ?>
<?php if (isset($urls->urlc) && !empty($urls->urlc)) { ?>
<a class="maska-link" href="<?php echo $urls->urlc; ?>" <?php echo $linkTarget; ?>></a>
<?php } else { ?>
<a class="maska-link" href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language)); ?>"></a>
<?php } ?>
<div class="item-date">
<time datetime="<?php echo JHtml::_('date', $this->item->created, 'c'); ?>" itemprop="dateCreated">
<?php echo JText::sprintf(JHtml::_('date', $this->item->created, JText::_('DATE_FORMAT_LC3'))); ?>
</time>
</div>
<div class="item-text">
<?php if ($params->get('show_title')) : ?>
<h2 class="item-title" itemprop="headline">
<?php if ($params->get('link_titles') && $params->get('access-view')) : ?>
<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language)); ?>" itemprop="url">
<?php echo $this->escape($this->item->title); ?>
</a>
<?php else : ?>
<?php echo $this->escape($this->item->title); ?>
<?php endif; ?>
</h2>
<?php endif; ?>
<?php echo $this->item->introtext; ?>
<?php if ($params->get('show_readmore') && $this->item->readmore) :
if ($params->get('access-view')) :
$link = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language));
else :
$menu = JFactory::getApplication()->getMenu();
$active = $menu->getActive();
$itemId = $active->id;
$link = new JUri(JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId, false));
$link->setVar('return', base64_encode(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language)));
endif; ?>
<?php echo JLayoutHelper::render('joomla.content.readmore', array('item' => $this->item, 'params' => $params, 'link' => $link)); ?>
<?php endif; ?>
<?php if (isset($urls->urlc) && !empty($urls->urlc)) { ?>
<?php echo JLayoutHelper::render('joomla.content.readmore', array('item' => $this->item, 'params' => $params, 'link' => $link)); ?>
<?php } ?>
</div>
<?php } ?>
</div>
Tutaj widać warunek dla wypełnionego pola URL C:
Kod PHP:
<?php if (isset($urls->urlc) && !empty($urls->urlc)) { ?>
<a class="maska-link" href="<?php echo $urls->urlc; ?>" <?php echo $linkTarget; ?>></a>
<?php } else { ?>
<a class="maska-link" href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language)); ?>"></a>
<?php } ?>
Niestety, trzeba sie trochę pouczyć ;)