Hi all,
I've read through the documentation and mustache guide on their site and thought I had a handle on it but it appears not. I'm trying to show a list of items from a a database table using a template. I started by creating the template and then the data example to look at in the template viewer, but its not showing me the content and I dont know why. The relevent bits are below.
<h4>{{section}}</h4>
<ul class="comments">
{{#messages}}
<li id="{{messageid}}" class="item">
<div class="userpix">{{userpix}}</div>
<div class="msg-body">
<div class="header">
<div class="username">{{username}}</div>
<div class="date">{{date}}</div>
</div>
<div class="message">{{message}}</div>
</div>
<div class="social"><a href=#">Like</a> | <a href=#">Delete</a></div>
</li>
{{/messages}}
</ul>
Example context (json):Could someone tell me what i'm doing wrong? I really want to learn templating but its proving harder than I thought
{
"section": "Topic 5",
"messages": [
{"messageid": 12, "userpix": "Picture Here", "username": "Kieran Briggs", "date": "22 April", "message": "content of the message"},
{"messageid": 14, "userpix": "Picture Here", "username": "Tony Stark", "date": "2 April", "message": "I am Iron Man"}
]
}