Ver Mensaje Individual
  #3 (permalink)  
Antiguo 14/03/2012, 11:31
Dani83
 
Fecha de Ingreso: septiembre-2011
Ubicación: Lorca
Mensajes: 66
Antigüedad: 12 años, 8 meses
Puntos: 1
Respuesta: Crear etiquetas H1 en Magento

Hola,

Lo que pasa es que tengo que modificar el header para que no aparezca el mismo h1 del logo en cada página, además, creo que sería mejor un h1 con el title de la tienda en el header de la página principal.
Además, el h1 del logo tiene el siguiente código y no se ve en herramientas como woorank, es como que no existe:

<h1 class="logo"><a href="http://www.tilagrowshop.com/"><img src="http://www.tilagrowshop.com/skin/frontend/default/tila/images/logo_diosa.png" alt="Grow Shop - Grow Shop Online - TilaGrowShop.com" /></a></h1>

Después de investigar he visto que tengo que modificar 3 archivos:
1. Para quitar el h1 del logo tengo que editar el archivo header.phtml, ya que solo quiero que lo tenga la home y me sale en todas las páginas de mi sitio. Al editar el archivo me encuentro con el siguiente código:

<div class="header">

<h1 class="logo"><a href="<?php echo $this->getUrl('') ?>"><img src="<?php
//if(Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms' && Mage::getSingleton('cms/page')->getIdentifier() == 'home')
$currentUrl = $this->helper('core/url')->getCurrentUrl();
if ($currentUrl == 'http://www.tilagrowshop.com/') {
echo $this->getLogoSrc();
}
else {

$pajar = 'https://www.tilagrowshop.com/customer/account/login/';
$pajar .= 'https://www.tilagrowshop.com/customer/account/forgotpassword/';
$pajar .= 'https://www.tilagrowshop.com/customer/account/index/';
$pajar .= 'https://www.tilagrowshop.com/customer/account/edit/';
$pajar .= 'https://www.tilagrowshop.com//customer/account';
$pajar .= 'https://www.tilagrowshop.com/customer/address/new/';
$pajar .= 'https://www.tilagrowshop.com/sales/order/history/';
$pajar .= 'https://www.tilagrowshop.com/sales/billing_agreement/';
$pajar .= 'https://www.tilagrowshop.com/sales/recurring_profile/';
$pajar .= 'https://www.tilagrowshop.com/review/customer/';
$pajar .= 'https://www.tilagrowshop.com/tag/customer/';
$pajar .= 'https://www.tilagrowshop.com/wishlist/';
$pajar .= 'https://www.tilagrowshop.com/downloadable/customer/products/';
$pajar .= 'https://www.tilagrowshop.com/newsletter/manage/';
$pajar .= 'https://www.tilagrowshop.com//contacts';
$pajar .= 'https://www.tilagrowshop.com/contacts';
$pajar .= 'https://www.tilagrowshop.com/customer/account/create/';
$pajar .= 'http://www.tilagrowshop.com/checkout/cart/';
$pajar .= 'http://www.tilagrowshop.com/checkout/onepage/';
$pajar .= 'https://www.tilagrowshop.com/checkout/onepage/success/';
$pajar .= 'http://www.tilagrowshop.com/contacts/index/';
$pajar .= 'http://www.tilagrowshop.com//contacts/';
$pajar .= 'https://www.tilagrowshop.com/checkout/onepage/index/';
$pajar .= 'https://www.tilagrowshop.com/customer/account/confirmation/email/';
$pajar .= 'https://www.tilagrowshop.com/customer/account/logoutSuccess/';
//error_log($currentUrl,0);
if (strpos($pajar,$currentUrl)===false) {
echo $this->getLogoSrc();
} else {
echo $this->getSkinUrl() . 'images/logo_diosa2.png';
}
}
?>" alt="<?php echo $this->getLogoAlt() ?>" /></a></h1>

¿Como tengo que modificar este código para que la etiqueta h1 sea el título de la página en lugar del logo?¿Se borraría el logo de la web?

2. Para poner las etiquetas h1 en las páginas de categorías para que el nombre de dicha categría sea un h1, tengo que modificar el archivo view.phtml y me sale el siguiente código:

?>
<?php
/**
* Category layered navigation
*
* @see Mage_Catalog_Block_Layer_View
*/
?>
<?php if($this->canShowBlock()): ?>
<div class="block block-layered-nav">
<div class="block-title">
<strong><span><?php echo $this->__('Shop by') ?></span></strong>
</div>
<div class="block-content">
<?php echo $this->getStateHtml() ?>
<?php if($this->canShowOptions()): ?>
<p class="block-subtitle"><?php echo $this->__('Shopping Options') ?></p>
<dl id="narrow-by-list">
<?php $_filters = $this->getFilters() ?>
<?php foreach ($_filters as $_filter): ?>
<?php if($_filter->getItemsCount()): ?>
<dt><?php echo $this->__($_filter->getName()) ?></dt>
<dd><?php echo $_filter->getHtml() ?></dd>
<?php endif; ?>
<?php endforeach; ?>
</dl>
<script type="text/javascript">decorateDataList('narrow-by-list')</script>
<?php endif; ?>
</div>
</div>
<?php endif; ?>

Necesito saber que código tengo que poner para que el h1 sea el nombre de la categoría en si.

Saludos!!
__________________
Grow Shop Online - Semillas y Cultivo Marihuana | Tila Grow Shop