Using App.Data["whatever"] and getting each item presentation

Oct 4, 2014 at 1:14 PM

Is it possible to use App.Data["news"] to get all the news items and also get the item presentation for that

so lets say each news item has a presentation with 2 values, color and background

how would i go about getting the value of each of that so i could do something like

<div class="@color presentation value here" data-bg="@background presentation value here"> @Content.title Is this possible?
Oct 7, 2014 at 4:39 PM
Hi nokiko,

Getting presentation entities from App.Data[] with is not possible ATM. The problem is that a single entity (news item in your case) could have multiple presentation items in different lists / templates. A presentation entity is always bound to the combination of a template and a content entity.

I'd create the "presentation" fields directly in the news content type to solve this problem. Of course you could also create an entity field in the news content type where the user can choose one of the presentation entities (if you do that, please do not call the field "Presentation", this might cause problems in future versions of 2sxc).

Best regards