Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

[Solved]Title in left sidebar
 
heidimari
Sr. Member
 
Avatar
Total Posts:  215
Joined:  2011-06-12
 

Ok, without any knowledge about html, phtml, xml or css I have managed to find out something about adding a title to the left sidebar above the vertical navigation. I have asked several times in here but do not get any help so I am hoping someone could guide me how to finnish this.

I have added this code to left.phtml (after removeing some h4 code - I found an explanation somewhere in the forum...)

<?=$this->getVertnavUrl()?><img src=\"<?=$this->getSkinUrl(\'images/my-cart-bg.jpg\')?>\" alt=\"<?=(\'Produkt Kategorier\')?>\"/><strong><span>PRODUKT KATEGORIER</span
</
strong>
</
a>

This gives me a bacckground image that I want and the title but they are under each other (please see screenshot)

Could someone tell me how I can get the title \"PRODUKT KATEGORIER\” on top of the image? And with that I mean that the title should have the image as backkground…

Or is there another way of doing this?

This is thewhole left.phtml code

?>
<div class=\"vertnav-container\">
    <
div class=\"\">
<?=$this->getVertnavUrl()?><img src=\"<?=$this->getSkinUrl(\'images/my-cart-bg.jpg\')?>\" alt=\"<?=(\'Produkt Kategorier\')?>\"/><strong><span>PRODUKT KATEGORIER</span
</
strong>
</
a>
<?php $store_categories $this->toLinearArray($this->getStoreCategories()) ?>
<?php 
if ($count count($store_categories)): ?>
        
<ul id=\"vertnav\">
<?php endif; ?>
<?php 
foreach ($store_categories as $i => $_category): ?><?php $class = array() ?>
<?php 
if ($count == 1): ?>
<?php $class[] 
\'only\' ?>
<?php 
elseif (! $i): ?>
<?php $class[] 
\'first\' ?>
<?php 
elseif ($i == $count-1): ?>
<?php $class[] 
\'last\' ?>
<?php 
endif; ?>
<?php 
if (isset($store_categories[$i+1]) && $this->isCategoryActive($store_categories[$i+1])) $class[] \'prev\'?>
<?php 
if (isset($store_categories[$i-1]) && $this->isCategoryActive($store_categories[$i-1])) $class[] \'next\'?>
<?php 
echo $this->drawOpenCategoryItem($_category0$class?>
<?php 
endforeach ?>
<?php 
if ($count): ?>
        
</ul>
<?php endif; ?>
    
</div>
</
div>
Image Attachments
screenshot navbar title.png
 
Magento Community Magento Community
Magento Community
Magento Community
 
isyan
Member
 
Total Posts:  49
Joined:  2010-03-04
 

Hi

put this text PRODUKT KATEGORIER inside a DIV and then make the image a background of the DIV..

for ex.

<div class="product-title">
<
span>PRODUKT KATEGORIER</span>
</
div>

then on your CSS

div.product-title {
   background
url('location-of-your-image'no-repeat;
}

best regards,

heidimari - 22 August 2011 02:47 AM

Ok, without any knowledge about html, phtml, xml or css I have managed to find out something about adding a title to the left sidebar above the vertical navigation. I have asked several times in here but do not get any help so I am hoping someone could guide me how to finnish this.

I have added this code to left.phtml (after removeing some h4 code - I found an explanation somewhere in the forum...)

<?=$this->getVertnavUrl()?><img src=\"<?=$this->getSkinUrl(\'images/my-cart-bg.jpg\')?>\" alt=\"<?=(\'Produkt Kategorier\')?>\"/><strong><span>PRODUKT KATEGORIER</span
</
strong>
</
a>

This gives me a bacckground image that I want and the title but they are under each other (please see screenshot)

Could someone tell me how I can get the title \"PRODUKT KATEGORIER\” on top of the image? And with that I mean that the title should have the image as backkground…

Or is there another way of doing this?

This is thewhole left.phtml code

?>
<div class=\"vertnav-container\">
    <
div class=\"\">
<?=$this->getVertnavUrl()?><img src=\"<?=$this->getSkinUrl(\'images/my-cart-bg.jpg\')?>\" alt=\"<?=(\'Produkt Kategorier\')?>\"/><strong><span>PRODUKT KATEGORIER</span
</
strong>
</
a>
<?php $store_categories $this->toLinearArray($this->getStoreCategories()) ?>
<?php 
if ($count count($store_categories)): ?>
        
<ul id=\"vertnav\">
<?php endif; ?>
<?php 
foreach ($store_categories as $i => $_category): ?><?php $class = array() ?>
<?php 
if ($count == 1): ?>
<?php $class[] 
\'only\' ?>
<?php 
elseif (! $i): ?>
<?php $class[] 
\'first\' ?>
<?php 
elseif ($i == $count-1): ?>
<?php $class[] 
\'last\' ?>
<?php 
endif; ?>
<?php 
if (isset($store_categories[$i+1]) && $this->isCategoryActive($store_categories[$i+1])) $class[] \'prev\'?>
<?php 
if (isset($store_categories[$i-1]) && $this->isCategoryActive($store_categories[$i-1])) $class[] \'next\'?>
<?php 
echo $this->drawOpenCategoryItem($_category0$class?>
<?php 
endforeach ?>
<?php 
if ($count): ?>
        
</ul>
<?php endif; ?>
    
</div>
</
div>
 
Magento Community Magento Community
Magento Community
Magento Community
 
heidimari
Sr. Member
 
Avatar
Total Posts:  215
Joined:  2011-06-12
 

Thank you isyan your way looks much easier but should I add the image code in vertnav.css or styles.css? And exactly where in the css file should it go. I can`t find any similar codes in either files…

 
Magento Community Magento Community
Magento Community
Magento Community
 
isyan
Member
 
Total Posts:  49
Joined:  2010-03-04
 

the css will go in skin/frontend/YOUR_PACKAGE/YOUR_TEMPLATE/css/style.css

just insert the code there.. but make sure to change the url of your image..

hope it helps

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top