Get list of categories with urls

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
User avatar
TobiasMadsen
Posts: 14
Joined: 04 Dec 2020, 09:57

Get list of categories with urls

Post by TobiasMadsen » 21 Dec 2020, 12:04

Hi again.

First of all, thank you for the great support you provide.

I would like to show a grid of the categories (maybe with their picture) on the frontpage of the shop.
How do i get a list of the categories pushed to catalog/home for instance?

What will be the best way to achieve this?

Sorry for all the questions, but i have never worked with something build as Aimeos is - only plain laravel.

Have a nice Christmas.

User avatar
aimeos
Administrator
Posts: 8616
Joined: 01 Jan 1970, 00:00

Re: Get list of categories with urls

Post by aimeos » 22 Dec 2020, 11:19

The catalog/home component already loads the categories of the first level so you have everything you need. You only have to overwrite the template in your own extension to adapt the layout to your needs:
https://github.com/aimeos/ai-client-htm ... andard.php
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
TobiasMadsen
Posts: 14
Joined: 04 Dec 2020, 09:57

Re: Get list of categories with urls

Post by TobiasMadsen » 22 Dec 2020, 15:43

Yes i was on to that.

I can't make much out of the template. What is homeTree for instance?
Is there a detailed documentation of the templates anywhere or do you know where i can learn more?

Sorry, i feel like a noob :(

User avatar
aimeos
Administrator
Posts: 8616
Joined: 01 Jan 1970, 00:00

Re: Get list of categories with urls

Post by aimeos » 24 Dec 2020, 08:32

homeTree is an instance of a catalog item:
https://github.com/aimeos/aimeos-core/b ... andard.php

You can get the child nodes using

Code: Select all

$item->getChildren()
The code is already in the template:
https://github.com/aimeos/ai-client-htm ... hp#L56-L62
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply