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
Hi everyone
I can retrieve the value of my fields using @CurrentPage.alias ,
the problem is that I want to add a condition , but I do not know the syntax , *
something like @CurrentPage.alia.where..............
That will return a dynamic object, so you must know the syntax to continue.
You should be able to get an equal, strongly-typed object from @Model.Content, in which case you can use Intellisense to form the query.
Hi khansaa111,
Since you are using the dynamic implementation of Razor you can use this syntax below to implement a where condition in your Razor.
In the code below you will get pages where it does not have site UmbracoNaviHide to true. https://our.umbraco.org/wiki/reference/umbraco-best-practices/umbraconavihide
@CurrentPage.Alias.Where("Visible");
Then you can use it in a foreach loop for instance to loop page to a navigation or something like that.
If you have a concrete example of what you are trying to use in your Where clause then I would try to provide you some working example.
Hope this helps,
/Dennis
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
condition where in umbraco
Hi everyone
I can retrieve the value of my fields using @CurrentPage.alias ,
the problem is that I want to add a condition , but I do not know the syntax , *
something like @CurrentPage.alia.where..............
That will return a dynamic object, so you must know the syntax to continue.
You should be able to get an equal, strongly-typed object from @Model.Content, in which case you can use Intellisense to form the query.
Hi khansaa111,
Since you are using the dynamic implementation of Razor you can use this syntax below to implement a where condition in your Razor.
In the code below you will get pages where it does not have site UmbracoNaviHide to true. https://our.umbraco.org/wiki/reference/umbraco-best-practices/umbraconavihide
Then you can use it in a foreach loop for instance to loop page to a navigation or something like that.
If you have a concrete example of what you are trying to use in your Where clause then I would try to provide you some working example.
Hope this helps,
/Dennis
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.