overrider template.

Moderator: alikon

Forum rules
Regole Forum
Post Reply
Antony88
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Mon Sep 05, 2011 4:04 pm

overrider template.

Post by Antony88 » Thu Jun 14, 2012 11:00 am

Buongiorno e buona giornata a tutti.
Su questo sito http://www.studiolonoce.net, uso il template gratuito "tk gen free" scaricato da qui: http://www.joomla.it/anteprima-template ... nfree.html.

Il template è installato sull'ultima versione di joomla 2.5.4.

Ad ogni articolo sul link riguardante l'autore vorrei aggiungere il tag "rel author" e vorrei far scomparire la scritta "TPL_WARP_PUBLISHED_ON"
Ho cercato tra le cartelle per fare l'ovverider del template e ho trovato il file "default.php" per poter fare la modifica.
Solo che non sto riuscendo a capire come inserire il tag su questo codice.. spero in un vostro aiuto :) questo è il codice che ho trovato nel file da modificare:

Code: Select all

<?php
/**
* @package   Warp Theme Framework
* @author    YOOtheme http://www.yootheme.com
* @copyright Copyright (C) YOOtheme GmbH
* @license   http://www.gnu.org/licenses/gpl.html GNU/GPL
*/

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

// get view
$menu = JSite::getMenu()->getActive();
$view = is_object($menu) && isset($menu->query['view']) ? $menu->query['view'] : null;

JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');

// Create shortcuts to some parameters.
$params        = $this->item->params;
$images        = json_decode($this->item->images);
$urls        = json_decode($this->item->urls);
$canEdit    = $this->item->params->get('access-edit');
$user        = JFactory::getUser();

?>

<div id="system">

    <?php if ($this->params->get('show_page_heading', 1)) : ?>
    <h1 class="title"><?php echo $this->escape($this->params->get('page_heading')); ?></h1>
    <?php endif; ?>

    <article class="item"<?php if ($view != 'article') printf(' data-permalink="%s"', JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catslug), true, -1)); ?>>

        <?php if ($params->get('show_title')) : ?>
        <header>

            <?php if (!$this->print) : ?>
                <?php if ($params->get('show_email_icon')) : ?>
                <div class="icon email"><?php echo JHtml::_('icon.email',  $this->item, $params); ?></div>
                <?php endif; ?>
            
                <?php if ($params->get('show_print_icon')) : ?>
                <div class="icon print"><?php echo JHtml::_('icon.print_popup',  $this->item, $params); ?></div>
                <?php endif; ?>
            <?php else : ?>
                <div class="icon printscreen"><?php echo JHtml::_('icon.print_screen',  $this->item, $params); ?></div>
            <?php endif; ?>
    
            <h1 class="title"><?php echo $this->escape($this->item->title); ?></h1>

            <?php if ($params->get('show_create_date') || ($params->get('show_publish_date') || ($params->get('show_author') && !empty($this->item->author)) || $params->get('show_category'))) : ?>
            <p class="meta">
        
                <?php
                    
                    if ($params->get('show_author') && !empty($this->item->author )) {
                        
                        $author = $this->item->created_by_alias ? $this->item->created_by_alias : $this->item->author;
                        
                        if (!empty($this->item->contactid) && $params->get('link_author') == true) {
                        
                            $needle = 'index.php?option=com_contact&view=contact&id=' . $this->item->contactid;
                            $menu = JFactory::getApplication()->getMenu();
                            $item = $menu->getItems('link', $needle, true);
                            $cntlink = !empty($item) ? $needle . '&Itemid=' . $item->id : $needle;
                        
                            echo JText::sprintf('COM_CONTENT_WRITTEN_BY', JHtml::_('link', JRoute::_($cntlink), $author));
                        } else {
                            echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author);
                        }
    
                    }
    
                    if ($params->get('show_create_date')) {
                        echo ' '.JText::_('TPL_WARP_ON').' <time datetime="'.substr($this->item->created, 0,10).'" pubdate>'.JHtml::_('date', $this->item->created, JText::_('DATE_FORMAT_LC3')).'</time>';
                    }
                    
                    if ($params->get('show_publish_date')) {  
                        echo ' '.JText::_('TPL_WARP_PUBLISHED_ON').' <time datetime="'.substr($this->item->publish_up, 0,10).'" pubdate>'.JHtml::_('date',$this->item->publish_up, JText::_('DATE_FORMAT_LC3')).'</time>';  
                    }

                    if (($params->get('show_author') && !empty($this->item->author )) || $params->get('show_create_date')) {
                        echo '. ';
                    }
                
                    if ($params->get('show_category')) {
                        echo JText::_('TPL_WARP_POSTED_IN').' ';
                        $title = $this->escape($this->item->category_title);
                        $url = '<a href="'.JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catslug)).'">'.$title.'</a>';
                        if ($params->get('link_category') AND $this->item->catslug) {
                            echo $url;
                        } else {
                            echo $title;
                        }
                    }
                
                ?>    
            
            </p>
            <?php endif; ?>

        </header>
        <?php endif; ?>
    
        <?php
        
            if (!$params->get('show_intro')) {
                echo $this->item->event->afterDisplayTitle;
            }
        
            echo $this->item->event->beforeDisplayContent;

            if (isset ($this->item->toc)) {
                echo $this->item->toc;
            }
            
        ?>

        <div class="content clearfix">

        <?php
        
            if ($params->get('access-view')) {

                if (isset($urls) AND ((!empty($urls->urls_position) AND ($urls->urls_position=='0')) OR ($params->get('urls_position')=='0' AND empty($urls->urls_position) ))
                    OR (empty($urls->urls_position) AND (!$params->get('urls_position')))) {
                        echo $this->loadTemplate('links');
                }

                if (isset($images->image_fulltext) and !empty($images->image_fulltext)) {
                    $imgfloat = (empty($images->float_fulltext)) ? $params->get('float_fulltext') : $images->float_fulltext;
                    $class = (htmlspecialchars($imgfloat) != 'none') ? ' class="size-auto align-'.htmlspecialchars($imgfloat).'"' : ' class="size-auto"';
                    $title = ($images->image_fulltext_caption) ? ' title="'.htmlspecialchars($images->image_fulltext_caption).'"' : '';
                    echo '<img'.$class.$title.' src="'.htmlspecialchars($images->image_fulltext).'" alt="'.htmlspecialchars($images->image_fulltext_alt).'" />';
                }

                echo $this->item->text;
            
                if (isset($urls) AND ((!empty($urls->urls_position)  AND ($urls->urls_position=='1')) OR ( $params->get('urls_position')=='1') )) {
                    echo $this->loadTemplate('links');
                }
            
            // optional teaser intro text for guests
            } elseif ($params->get('show_noauth') == true AND $user->get('guest')) {
                
                echo $this->item->introtext;
                
                // optional link to let them register to see the whole article.
                if ($params->get('show_readmore') && $this->item->fulltext != null) {
                    $link1 = JRoute::_('index.php?option=com_users&view=login');
                    $link = new JURI($link1);
                    echo '<p class="links">';
                    echo '<a href="'.$link.'">';
                    $attribs = json_decode($this->item->attribs);
        
                    if ($attribs->alternative_readmore == null) {
                        echo JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
                    } elseif ($readmore = $this->item->alternative_readmore) {
                        echo $readmore;
                        if ($params->get('show_readmore_title', 0) != 0) {
                            echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
                        }
                    } elseif ($params->get('show_readmore_title', 0) == 0) {
                        echo JText::sprintf('COM_CONTENT_READ_MORE_TITLE');    
                    } else {
                        echo JText::_('COM_CONTENT_READ_MORE');
                        echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
                    }
                    
                    echo '</a></p>';
                }
            }
            
        ?>
        </div>

        <?php if ($canEdit) : ?>
        <p class="edit"><?php echo JHtml::_('icon.edit', $this->item, $params); ?> <?php echo JText::_('TPL_WARP_EDIT_ARTICLE'); ?></p>
        <?php endif; ?>

        <?php echo $this->item->event->afterDisplayContent; ?>
    
    </article>

</div>

Vi ringrazio e vi saluto :)

WORCOM
Joomla! Apprentice
Joomla! Apprentice
Posts: 43
Joined: Sun Jul 27, 2014 8:26 pm
Contact:

Re: overrider template.

Post by WORCOM » Tue Aug 05, 2014 4:35 pm

Aggiorna all' ultima versione joomla 3


Post Reply

Return to “Template - Grafica”