Magento Forum

   
$_category = $this->getCurrentCategory(); always empty - need category title
 
DavidlBoidl
Member
 
Total Posts:  32
Joined:  2009-03-04
 

hi,

all that i want is to get the current category name in this file: 2coloumns-left.phtml…

i tried $_category = $this->getCurrentCategory(); but $_category is always empty, how i can get the title?

i will pay 20 dollars immidiately for the right answer, please help me smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
brendanb
Mentor
 
Total Posts:  1077
Joined:  2008-07-16
London, United Kingdom
 

Hi David,

what page are you trying to do this on? Home Page or some other place like product.list?
can you elaborate.

cheers
Brendan

 
Magento Community Magento Community
Magento Community
Magento Community
 
DavidlBoidl
Member
 
Total Posts:  32
Joined:  2009-03-04
 

hi,

thanks for your answer!

i’m trying to do this from the category list

 
Magento Community Magento Community
Magento Community
Magento Community
 
brendanb
Mentor
 
Total Posts:  1077
Joined:  2008-07-16
London, United Kingdom
 

ok,

but the 2coloumns-left.phtml is like a template file for calling other sub-pages.
Do you want to show the category name on a particular page on your site?
Like the Product.List page or the product.view page or some other page?

brendan

 
Magento Community Magento Community
Magento Community
Magento Community
 
DavidlBoidl
Member
 
Total Posts:  32
Joined:  2009-03-04
 

i want to change <div class="outline-creator">
to <div class="outline-creator" style="http://aaa/..../category-name.jpg"> in this file, don’t know another way :(

the result will be such a page like in screenshot:

Image Attachments
shopdesign.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
DavidlBoidl
Member
 
Total Posts:  32
Joined:  2009-03-04
 

of course style="background-image:url(url.jpg)"…

 
Magento Community Magento Community
Magento Community
Magento Community
 
lefrancaiz
Jr. Member
 
Total Posts:  13
Joined:  2008-04-01
 

I think you’d have to edit the file template/catalog/category/view.phtml instead… Not too sure.

 
Magento Community Magento Community
Magento Community
Magento Community
 
smily
Jr. Member
 
Avatar
Total Posts:  15
Joined:  2008-05-05
Sydney, Australia
 

I think if you use layered navigation you can try:

echo $this->htmlEscape(Mage::getModel(’catalog/layer_filter_category’)->getCategory()->getName());

maybe…

 
Magento Community Magento Community
Magento Community
Magento Community
 
brendanb
Mentor
 
Total Posts:  1077
Joined:  2008-07-16
London, United Kingdom
 

ok,

so as lefrancaiz has said the template/catalog/category/view.phtml is the place to look to edit this template.

But obviously the css is where you need to put the background-image

brendan

 
Magento Community Magento Community
Magento Community
Magento Community
 
DavidlBoidl
Member
 
Total Posts:  32
Joined:  2009-03-04
 

lefrancaiz your solution doesnt work :( problem: Notice: Use of undefined constant ’catalog - assumed ‘’catalog’ in /var/www/web9/html/fitnessonlineshop/magento/app/design/frontend/default/modern/template/page/2columns-left.phtml on line 45

thanks for the tipp with view.phtml, but i dont know how this can help me, because i want to set a background image for the outline-creator div and this is created in the 2coloumns-left.phtml and not in the catalog/category/view.phtml or is there another way for my problem?

thanks for your help

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