Foros del Web » Programando para Internet » PHP »

template override joomla item que no herede modulos categoria padre

Estas en el tema de template override joomla item que no herede modulos categoria padre en el foro de PHP en Foros del Web. hola, llevo bastante dándole vueltas a un asunto y quería preguntar cómo es posible ue al accder a un ítem de joomla (un artículo) de ...
  #1 (permalink)  
Antiguo 24/02/2012, 06:17
 
Fecha de Ingreso: agosto-2010
Mensajes: 68
Antigüedad: 13 años, 8 meses
Puntos: 1
template override joomla item que no herede modulos categoria padre

hola, llevo bastante dándole vueltas a un asunto y quería preguntar cómo es posible ue al accder a un ítem de joomla (un artículo) de una categoría, desaparezcan los módulos asociados a esa categoría padre. Me han dicho que con template override, intuyo que tengo que tocar el archivo default_articles.php que viene dentro del template y a su vez dentro de la carpeta html, pero no sé qué parte del código tocar para hacer QUE SÖLO ME AFECTE A LO ARTÏCULOS DE LA SECCIÖN DE NOTICIAS y no a todos los artículos.

os pongo el código del archivo default_articles.php por si me pudieran orientar qué tocar para conseguir lo que quiero

<?php
/**
* @version $Id: default_articles.php 22287 2011-10-26 05:32:17Z github_bot $
* @package Joomla.Site
* @subpackage com_content
* @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

// no direct access
defined('_JEXEC') or die;

JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::core();

// Create some shortcuts.
$params = &$this->item->params;
$n = count($this->items);
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
?>

<?php if (empty($this->items)) : ?>

<?php if ($this->params->get('show_no_articles',1)) : ?>
<p><?php echo JText::_('COM_CONTENT_NO_ARTICLES'); ?></p>
<?php endif; ?>

<?php else : ?>

<form action="<?php echo htmlspecialchars(JFactory::getURI()->toString()); ?>" method="post" name="adminForm" id="adminForm">
<?php if ($this->params->get('show_headings') || $this->params->get('filter_field') != 'hide' || $this->params->get('show_pagination_limit')) :?>
<fieldset class="filters">
<?php if ($this->params->get('filter_field') != 'hide') :?>
<legend class="hidelabeltxt">
<?php echo JText::_('JGLOBAL_FILTER_LABEL'); ?>
</legend>

<div class="filter-search">
<label class="filter-search-lbl" for="filter-search"><?php echo JText::_('COM_CONTENT_'.$this->params->get('filter_field').'_FILTER_LABEL').' '; ?></label>
<input type="text" name="filter-search" id="filter-search" value="<?php echo $this->escape($this->state->get('list.filter')); ?>" class="inputbox" onchange="document.adminForm.submit();" title="<?php echo JText::_('COM_CONTENT_FILTER_SEARCH_DESC'); ?>" />
</div>
<?php endif; ?>

<?php if ($this->params->get('show_pagination_limit')) : ?>
<div class="display-limit">
<?php echo JText::_('JGLOBAL_DISPLAY_NUM'); ?> 
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<?php endif; ?>

<!-- @TODO add hidden inputs -->
<input type="hidden" name="filter_order" value="" />
<input type="hidden" name="filter_order_Dir" value="" />
<input type="hidden" name="limitstart" value="" />
</fieldset>
<?php endif; ?>

<table class="category">
<?php if ($this->params->get('show_headings')) :?>
<thead>
<tr>
<th class="list-title" id="tableOrdering">
<?php echo JHtml::_('grid.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder) ; ?>
</th>

<?php if ($date = $this->params->get('list_show_date')) : ?>
<th class="list-date" id="tableOrdering2">
<?php if ($date == "created") : ?>
<?php echo JHtml::_('grid.sort', 'COM_CONTENT_'.$date.'_DATE', 'a.created', $listDirn, $listOrder); ?>
<?php elseif ($date == "modified") : ?>
<?php echo JHtml::_('grid.sort', 'COM_CONTENT_'.$date.'_DATE', 'a.modified', $listDirn, $listOrder); ?>
<?php elseif ($date == "published") : ?>
<?php echo JHtml::_('grid.sort', 'COM_CONTENT_'.$date.'_DATE', 'a.publish_up', $listDirn, $listOrder); ?>
<?php endif; ?>
</th>
<?php endif; ?>

<?php if ($this->params->get('list_show_author',1)) : ?>
<th class="list-author" id="tableOrdering3">
<?php echo JHtml::_('grid.sort', 'JAUTHOR', 'author', $listDirn, $listOrder); ?>
</th>
<?php endif; ?>

<?php if ($this->params->get('list_show_hits',1)) : ?>
<th class="list-hits" id="tableOrdering4">
<?php echo JHtml::_('grid.sort', 'JGLOBAL_HITS', 'a.hits', $listDirn, $listOrder); ?>
</th>
<?php endif; ?>
</tr>
</thead>
<?php endif; ?>

<tbody>

<?php foreach ($this->items as $i => $article) : ?>
<?php if ($this->items[$i]->state == 0) : ?>
<tr class="system-unpublished cat-list-row<?php echo $i % 2; ?>">
<?php else: ?>
<tr class="cat-list-row<?php echo $i % 2; ?>" >
<?php endif; ?>
<?php if (in_array($article->access, $this->user->getAuthorisedViewLevels())) : ?>

<td class="list-title">
<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($art icle->slug, $article->catid)); ?>">
<?php echo $this->escape($article->title); ?></a>

<?php if ($article->params->get('access-edit')) : ?>
<ul class="actions">
<li class="edit-icon">
<?php echo JHtml::_('icon.edit',$article, $params); ?>
</li>
</ul>
<?php endif; ?>
</td>

<?php if ($this->params->get('list_show_date')) : ?>
<td class="list-date">
<?php echo JHtml::_('date',$article->displayDate, $this->escape(
$this->params->get('date_format', JText::_('DATE_FORMAT_LC3')))); ?>
</td>
<?php endif; ?>

<?php if ($this->params->get('list_show_author',1) && !empty($article->author )) : ?>
<td class="list-author">
<?php $author = $article->author ?>
<?php $author = ($article->created_by_alias ? $article->created_by_alias : $author);?>

<?php if (!empty($article->contactid ) && $this->params->get('link_author') == true):?>
<?php echo JHtml::_(
'link',
JRoute::_('index.php?option=com_contact&view=conta ct&id='.$article->contactid),
$author
); ?>

<?php else :?>
<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author); ?>
<?php endif; ?>
</td>
<?php endif; ?>

<?php if ($this->params->get('list_show_hits',1)) : ?>
<td class="list-hits">
<?php echo $article->hits; ?>
</td>
<?php endif; ?>

<?php else : // Show unauth links. ?>
<td>
<?php
echo $this->escape($article->title).' : ';
$menu = JFactory::getApplication()->getMenu();
$active = $menu->getActive();
$itemId = $active->id;
$link = JRoute::_('index.php?option=com_users&view=login&I temid='.$itemId);
$returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($art icle->slug));
$fullURL = new JURI($link);
$fullURL->setVar('return', base64_encode($returnURL));
?>
<a href="<?php echo $fullURL; ?>" class="register">
<?php echo JText::_( 'COM_CONTENT_REGISTER_TO_READ_MORE' ); ?></a>
</td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>

<?php // Code to add a link to submit an article. ?>
<?php if ($this->category->getParams()->get('access-create')) : ?>
<?php echo JHtml::_('icon.create', $this->category, $this->category->params); ?>
<?php endif; ?>

<?php // Add pagination links ?>
<?php if (!empty($this->items)) : ?>
<?php if (($this->params->def('show_pagination', 2) == 1 || ($this->params->get('show_pagination') == 2)) && ($this->pagination->get('pages.total') > 1)) : ?>
<div class="pagination">

<?php if ($this->params->def('show_pagination_results', 1)) : ?>
<p class="counter">
<?php echo $this->pagination->getPagesCounter(); ?>
</p>
<?php endif; ?>

<?php echo $this->pagination->getPagesLinks(); ?>
</div>
<?php endif; ?>
</form>
<?php endif; ?>

muchas gracias de antemano
  #2 (permalink)  
Antiguo 24/02/2012, 06:20
Avatar de repara2  
Fecha de Ingreso: septiembre-2010
Ubicación: München
Mensajes: 2.445
Antigüedad: 13 años, 7 meses
Puntos: 331
Respuesta: template override joomla item que no herede modulos categoria padre

http://www.forosdelweb.com/f119/
__________________
Fere libenter homines, id quod volunt, credunt.

Etiquetas: html, item, joomla, modulos, override, padre, template, categorias
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 10:24.