2sxc - One content-type, one list view, one cshtml, some rows not shown

166 views Asked by At

Using 2sxc to create a new app with only: - One content type - 15 rows of data - One view (razor, single cshtml file)

When I call the @foreach loop, only some of the data is shown in the list view (apparently the ones inserted in the current dnn module and only through the "new" button in the toolbar). If I add the row in the admin panel, it will not show. When I deleted the module and inserted it again, I can see the data in the admin panel, but not in my list view.

Attached screens.

I tried calling the data with:

@foreach(var Content in AsDynamic(Data["Default"])){...}

or

@foreach(var e in List.OrderBy(e => e.Content.Farmaco).Where(e => e.Content.Cat == "1")){
var Content = e.Content;
... }

but the result is the same.

Am I missing something really obvious?

DNN 9.1.1 2sxc 9.04.01

https://drive.google.com/file/d/0B-4bmuuNWVx2MUxxa0g1SExqUkE/view?usp=sharing

1

There are 1 answers

4
iJungleBoy On BEST ANSWER

Yes, you're clearly not familiar yet with "raw data" and items-assigned to a modules.

In our code you get the module-data with Data["Default"], whereas the raw-data you would get from a query (then also with Data["Default"] or Data["Whatever-Name-Your-Stream-In-Your-Query"])

If you want to work with all data, you would again use a query, or App.Data["TypeName"] and build on that.

Check out http://2sxc.org/en/blog/post/12-differences-when-templating-data-instead-of-content