Display list of categories ?

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!
Zaheer Abbas
Posts: 1
Joined: 19 Jul 2017, 11:55

Display list of categories ?

Post by Zaheer Abbas » 19 Jul 2017, 12:12

I had created a html template and now i am going to convert it in laravel with your package .
I want to display a list of categories in menu but when add below code to display categories in app.blade.php it shows an error that

(4/4) ErrorException
Undefined variable: enc (View: D:\xampp\htdocs\myproject\resources\views\app.blade.php) (View: D:\xampp\htdocs\myproject\resources\views\app.blade.php) (View: D:\xampp\htdocs\myproject\resources\views\app.blade.php)


<ul class="level-<?= $enc->attr( $level ); ?>">
<?php foreach( $this->get( 'nodes', [] ) as $item ) : ?>
<?php if( $item->getStatus() > 0 ) : ?>

<?php $id = $item->getId(); $config = $item->getConfig(); ?>
<?php $params['f_name'] = $item->getName( 'url' ); $params['f_catid'] = $id; ?>
<?php $class = ( $item->hasChildren() ? ' withchild' : ' nochild' ) . ( isset( $path[$id] ) ? ' active' : '' ); ?>
<?php $class .= ' catcode-' . $item->getCode() . ( isset( $config['css-class'] ) ? ' ' . $config['css-class'] : '' ); ?>

<li class="cat-item catid-<?= $enc->attr( $id . $class ); ?>" data-id="<?= $id; ?>" >

<a class="cat-item" href="<?= $enc->attr( $this->url( ( $item->getTarget() ?: $target ), $controller, $action, $params, [], $config ) ); ?>"><!--
--><div class="media-list"><!--

<?php foreach( $item->getListItems( 'media', 'icon' ) as $listItem ) : ?>
<?php if( ( $mediaItem = $listItem->getRefItem() ) !== null ) : ?>
<?= '-->' . $this->partial(
$this->config( 'client/html/common/partials/media', 'common/partials/media-default.php' ),
array( 'item' => $mediaItem, 'boxAttributes' => array( 'class' => 'media-item' ) )
) . '<!--'; ?>
<?php endif; ?>
<?php endforeach; ?>

--></div><!--
--><span class="cat-name"><?= $enc->html( $item->getName(), $enc::TRUST ); ?></span><!--
--></a>

<?php if( count( $item->getChildren() ) > 0 ) : ?>
<?php $values = array( 'nodes' => $item->getChildren(), 'path' => $path, 'params' => $params, 'level' => $level + 1 ); ?>
<?= $this->partial( $this->config( 'client/html/catalog/filter/partials/tree', 'catalog/filter/tree-default.php' ), $values ); ?>
<?php endif; ?>

</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>

In short i want to display categories , products in with my own design template. :|

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

Re: Display list of categories ?

Post by aimeos » 19 Jul 2017, 14:49

The easiest way is to add the output of "catalog/filter" inside your menu (no the whole code that generates the tree) and configure to display only the categories section only.

Code: Select all

<?= $aibody['catalog/filter'] ?>
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

hihaider196
Posts: 13
Joined: 27 Dec 2018, 07:32

Re: Display list of categories ?

Post by hihaider196 » 27 Dec 2018, 07:40

Hi All,
I am using header footer in your package, i am having problem in dropdown categories in my header, i have categories in my database which i have added through admin UI. Can you please tell me, to get that what should i include or exclude from which file along with path. I am new in Laravel so i need your help in Detail(as soon as possible), I shall be very thankful to you for this favor and AIMEOS IS GREAT.

Thankyou.

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

Re: Display list of categories ?

Post by aimeos » 27 Dec 2018, 12:42

It's unclear what you want to achieve. Can you please go into more details maybe with an example?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

hihaider196
Posts: 13
Joined: 27 Dec 2018, 07:32

Re: Display list of categories ?

Post by hihaider196 » 31 Dec 2018, 06:07

Hi
Can't see pictures of products on my live website,
Can you please tell me how to remove Public from live URLs
and Please tell me where to edit the admin portal?

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

Re: Display list of categories ?

Post by aimeos » 01 Jan 2019, 11:08

The Laravel "public" directory has to be the document root of your web site
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply