Display list of categories ?
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!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Posts: 1
- Joined: 19 Jul 2017, 11:55
Display list of categories ?
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.
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.
Re: Display list of categories ?
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, give us a star
If you like Aimeos, give us a star
-
- Posts: 13
- Joined: 27 Dec 2018, 07:32
Re: Display list of categories ?
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.
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.
Re: Display list of categories ?
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, give us a star
If you like Aimeos, give us a star
-
- Posts: 13
- Joined: 27 Dec 2018, 07:32
Re: Display list of categories ?
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?
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?
Re: Display list of categories ?
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, give us a star
If you like Aimeos, give us a star