Jump to content

Categories and Subcategories on homepage


Recommended Posts

Hi again!

It's me again, with another problem.

 

I am trying to have my categories and subcategories in my front page, but I'm not having much success....

I'd like to have the "Categories" as titles and then every subcategory after as a picture with a link to that subcategory.

Something like:

 

CATEGORY

<subcategory> <subcategory> <subcategory>

CATEGORY

<subcategory> <subcategory> <subcategory>

 

For the moment I have some kind of mockup with Vekia's HTML Block, you can see it here -> http://tester.photoboothparts.com/

It's just a bunch of pictures with static links to it's subcategories, so it's crude and functional.... But I'd like it to be dynamic. So whenever the guys at marketing / design want to add a category, or change a picture or whatever, this front page updates automatically.

 

I've been trying to use a module I've found around the forums (homecategories) but with it I can get my categories, but I have not been able to add the subcategories to it. I've tried a tutorial (also from Vekia) ( link ) but this is thought to work in the categories page, not at home, and I can't even get it to recognize that subcategories exist.

I'm probably doing everything wrong, but honestly don't know how to do this or what to try anymore.

Link to comment
Share on other sites

You definitely need a custom module. If you need to learn how to make one, I have a full course on module development for 1.6.
That said, what you want to do is have the module hooked to displayHome.

Pick your category ids, then for each instantiate a new category object, then use category::getSubcategories to get all subcategories for each. Assign to the template, loop through and then you can use the category.tpl template as base

Link to comment
Share on other sites

I followed your advice and with help from your tutorial, a lot of google-fu and some wall-bashing with my head, found a way to do it.

It's amateurish and lacks any kind of personalization, but I don't have the time to do more...

Maybe in my own free time i'll finish it and upload it here so people can use it if needed.

Thanks again!

Link to comment
Share on other sites

  • 10 months later...

Sorry what I did didn't work at all in the end.

I ended up making an HTML block, and just handmade a screen with a category grid myself. It's totally the worst solution possible because I need to be changing it every time something is updated, but it's the only one I could make work.

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...