Skip to content
This repository has been archived by the owner on Jan 25, 2020. It is now read-only.

Looping issue when rendering an object hierarchy to ul/li tags #94

Closed
Ampakinetic opened this issue Aug 22, 2015 · 1 comment
Closed

Comments

@Ampakinetic
Copy link

Hi, sorry this is probably user error rather than an adaro problem with but I'm struggling to make it work, and might be a simple thing I'm missing.

I'm trying to render an object structure such as

{
   name:"Home Page",
   url: "/",
   "sub-page1": {
        name: "Sub Page 1",
        url: "/sub-page1",
        "sub-sub-page1": {
             "name": "Sub Sub Page1",
             "url": "/sub-page1/sub-sub-page1"
        }
    }
}

to something like

  • Home Page
    • ... etc
      with a recursive partial, but I can't seem to loop through the variably named objects without causing an infinite loop.

      My current attempt looks like this, calling itself:

      <li>
          <a href="{url}">{name}</a>{#.}<ul>{>"components/menu/recurlist"/}</ul>{/.}
      </li>
      
@Ampakinetic
Copy link
Author

Closed, apparently dust can't handle this kind of object structure as according to http://stackoverflow.com/questions/32160692/looping-issue-when-rendering-an-object-hierarchy-using-dust-js-2-7-2-to-ul-li-ta

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant