Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I am trying to only pull certain items into a list trying this
var newsposts = selection.OrderByDescending(x => x.CreateDate).Where(x => x.GetPropertyValue<string>("newType2") == @PageTheme).ToList();
Page loads but nothing is brought back. I have 1 news page that I want all content to display on but if you are in a certain page theme only to bring back the news for that page. I am using an IF statement below to do this but the pagnation doesn't work.
there might be other things inside the view but from that bit of code, i think you can remove the @ symbol from @PageTheme
so it looks like:
var newsposts = selection.OrderByDescending(x => x.CreateDate).Where(x => x.GetPropertyValue<string>("newType2") == PageTheme).ToList();
as you are already inside a code block in razor you don't need the @ symbol to identify the variable.
Hi I will try this but I think it is not possible as i am using a multi selection list when creating the news article to allow the items to appear on multiple pages.
Also I think is better change order of statements, first where and after order,
of course PageTheme should be string
var newsposts = selection.Where(x => x.GetPropertyValue<string>("newType2") == PageTheme).OrderByDescending(x => x.CreateDate).ToList();
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted