This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

GrCOTE7
GrCOTE7

Simple Tree rendering

Hi, all :-)

I'm reading all the the documentation about OctoberCMS, and i'm now in that section...

Traits SimpleTree

For a best comprehension (As my english is rather poor), I systematically apply what I read...

And I meet a trouble with the SimpleTree 's trait :

I'don't succeed in rendering the front view as indicate in the documentation

I presume the base is correct: As we can see in this screen 's capture at the bottom right (The browser) , the field used for the hierarchy relation (parr) is well interpreated when we dieAndDump an array of the toNested() method...

But if I see the corresponding page in front end (wich get the default.htm of my testing component for that), the code doesn't get any view :-(...

{% macro renderChildren(item) %}
    {% import _self as SELF %}
    {% if item.children is not empty %}
        <ul>
            {% for child in item.children %}
                <li>{{ child.name }}{{ SELF.renderChildren(child) | raw }}</li>
            {% endfor %}
        </ul>
    {% endif %}
{% endmacro %}

{% import _self as SELF %}
{{ SELF.renderChildren(category) | raw }}

A complete github repository is here with the README instructions for a quick local installation...

Thanks to help me to pass this step:-) !

To soon.

Last updated

1-1 of 1

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.