1

I've read over some similar questions but I'm still stuck.

I have an array that looks like this:

[{"get_all_user_blogs": "(3,\"<p>Random Blog</p>\n\",\"<p>Blah</p>\n\")"}]

and the array is of length 2 but will obviously grow over time. I can loop over the array but I'm unsure how to extract the three variables in the object. I'm completely stuck on what I need to do. The Handlebars template receives the array as a parameter.

Edit: Here is the code that returns the three elements.

<ul>
    {{#each blog_list}}
        {{#each this}}
            <li><a href="/cp/blog/update/{{@../key}}/">{{this}}</a></li>
        {{/each}}
    {{/each}}
</ul>

But if try to use:

{{this[0]}}

it doesn't work as I would expect.

Cromulent
  • 3,788
  • 4
  • 31
  • 41
  • 1
    Does this answer your question? [How to iterate over array of objects in Handlebars?](https://stackoverflow.com/questions/22696886/how-to-iterate-over-array-of-objects-in-handlebars) – Shubham Dixit Apr 06 '21 at 08:12
  • That was the question I looked at first and I'm still having issues. I know you can use this but how do you refer to the three variables in the object? – Cromulent Apr 06 '21 at 08:21
  • I've updated the post with my exact code so you can see what I am doing wrong. – Cromulent Apr 06 '21 at 08:50
  • What are the "three variables"? – 76484 Apr 08 '21 at 02:13

0 Answers0