Jump to content

Display Parent Category Name in Category Module


bg1137

Recommended Posts

I would like to change the title of the Category module from "Categories" to be the Parent Category's Name. So, if you are on a subcategory page the Category Module would have the title of the Parent Category and if you are on the Parent Category page the title would be that Category Name. Any thoughts? Thanks!

Link to comment
Share on other sites

  • 2 months later...

I'm also interested into this. Can anyone comes with a solution for displaying the parent category name into categories block modules?

 

I would like to have instead the module title "categories", the parent category name. I tried to add {$category->name|escape:'htmlall':'UTF-8'} but it does not work.

Edited by marcos223 (see edit history)
Link to comment
Share on other sites

it's because this variable works only in foreach loop. In this case - it isn't possbile to change name of the block because it isn't in the foreach loop.

 

You can use javascript to change the title, if you're still interested with this - i can help you

Link to comment
Share on other sites

Hi

 

I'm talking about the default module called: blockcategories. The title of this block is "categories"..and then the categories are listed.

 

Is there any way to delete the title of the block and add instead "the main category title"?

 

For example I have this:

 

Module title: categories

category a

subcategory a1

subcategory a2

subcategory a3

category b

subcategory b1

subcategory b2

subcategory b3

 

I'm trying to remove the word "categories" from the module title bar, and replace it to the main category name , a subcategory belongs to.

 

For example if I click on subcategory a1, I would like to have instead this title:"categories", I would like to have "categegory a".

 

I tried to edit blockcategories.tpl, by deleting the word "categories" and add instead: {$category->name|escape:'htmlall':'UTF-8'}

 

but it does not work.

 

Any help will be much appreciated.

Edited by marcos223 (see edit history)
Link to comment
Share on other sites

Hi

 

I'm talking about the default module called: blockcategories. The title of this block is "categories"..and then the categories are listed.

 

Is there any way to delete the title of the block and add instead "the main category title"?

 

For example I have this:

 

Module title: categories

category a

subcategory a1

subcategory a2

subcategory a3

category b

subcategory b1

subcategory b2

subcategory b3

 

I'm trying to remove the word "categories" from the module title bar, and replace it to the main category name , a subcategory belongs to.

 

For example if I click on subcategory a1, I would like to have instead this title:"categories", I would like to have "categegory a".

 

I tried to edit blockcategories.tpl, by deleting the word "categories" and add instead: {$category->name|escape:'htmlall':'UTF-8'}

 

but it does not work.

 

Any help will be much appreciated.

 

hey it's your second topic about that i'm going to merge your threads

Link to comment
Share on other sites

it's because this variable works only in foreach loop. In this case - it isn't possbile to change name of the block because it isn't in the foreach loop.

 

You can use javascript to change the title, if you're still interested with this - i can help you

 

yes, I would like to use javascript for this if possible. can you help me?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...