0

I'm using the 2sxc module for the first time, so it is possible that I'm just being a newbie.

I created an app, added a content-type with 3 fields

  1. Name (translated)
  2. Email (translated)
  3. Phonenumber (translated)

Then I created a view

<h2>Werknemers</h2>

@foreach(var cont in AsDynamic(Data["Default"])){
    <div>
        @Edit.Toolbar(cont)
        <p>@cont.Naam<br>
        @cont.Email<br>
        @cont.Telefoonnummer</p>
    </div>
}

At first it was only showing the demo item. So I added an item with the "+" icon in the toolbar. And yes, this item gets added in the list.

But I have a lot more items in this content-type

Why is it only showing the data you added with the toolbar in the app itself and not the items you added through the admin of the app?

I hope anyone can help me.

Thanks in advance!

Chris Hammond
  • 8,873
  • 1
  • 26
  • 34

1 Answers1

0

You seem to not yet understand the difference between content-assigned-to-a-module (which is what you have right now), and all-content - which seems to be what you need.

The quick fix: use App.Data["YourTypeNameHere"] instead of Data["Default"].

But it would be better if you read up http://2sxc.org/en/blog/post/12-differences-when-templating-data-instead-of-content

iJungleBoy
  • 5,325
  • 1
  • 9
  • 21