A
A
anton_trofimov952019-02-07 23:14:01
Smarty
anton_trofimov95, 2019-02-07 23:14:01

How to display a directory on a page in Webasyst?

How to display store categories on webasyst on the created page?

{$_categories = $wa->shop->categories(0, 0, true, true)}

Something like this doesn't work.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Ushenin, 2019-03-06
@anton_trofimov95

Your line of code only assigns an $_categoriesarray of categories to a variable, but it doesn't show anything.
To show a list of categories, you need to write a loop using Smarty and HTML, like this:

{$_categories = $wa->shop->categories(0, 0, true, true)}
<ul>
    {foreach $_categories as $_category}
        <li><a href="{$_category.url}">{$_category.name|escape}</a></li>
    {/foreach}
</ul>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question