If you want to get meta under specific collection then i will make a property called MetaCollectionPage as ContentPicker then
var collectionPage = Umbraco.TypedContent( Model.Content.GetPropertyValue<int>("metaCollectionPage"));
var metas = collectionPage.Children; // these are metas
var a = Model.Content.Parent.Descendants().FirstOrDefault(x => x.GetPropertyValue<string>("Name").Contains("Collection1Name")).Descendants("Meta").Where(x => x.IsVisible());
I'm not understand for that I need add a special field for that. Also, it's born a lot of question from moderators.
I prefer use filter collection by name, but all my requests failed with error:
Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type
Can't build a entity request
Hi There,
This is my scema of site
So, i need get "meta"s on LandingPage for appropriate Parent. I've get meta from Collection1 as
Currently, I'm not understand how I can get meta from Collection2, Collection3 and etc.
Have any ideas? May be I can do it with names of collection?
Hi Aleksey,
Yes, you can do that names of collections, but it's little bit hardcoded.
Can you describe more, you need all 'meta' from nearest parent on the Landing page ?
Thanks, Oleksandr
I need an arrays of 'meta' from nearest parent on Landing page. I mean one array for Collection1, second array for Collection2 and etc.
For my case it's ok use a bit hardcoded by name. But I realy want to avoid hardcoded by Id.
I think you can try this one if you are on landingpage. so you can get all the meta under same parent.
If you want to get meta under specific collection then i will make a property called MetaCollectionPage as ContentPicker then
Can I write something like
?
Aleksey,
As I understand you need something like:
For same requests I get exception:
Aleksey do not use dynamic. I think it's not perfect solution for views.
Check the second part of my solution
I'm not understand for that I need add a special field for that. Also, it's born a lot of question from moderators. I prefer use filter collection by name, but all my requests failed with error:
Aleksey!
This is one of the easiest thing. i dont know why are you making it so complex and hard coded
Do you have skype id. give it to me we resolved it in a minute
is working on a reply...