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
Is it possible to pass objects into partial views, If so can anyone help me out.
I have a list of featured staff profiles saved on my home page and i want access to them in my partial view.
Please can someone help!!
Yes this is possible. You can either do it as standard MVC.
For Umbraco what I do is.
Change the inherits line at the top on your partial view from its default
to Something like either of these depending on what you want to do.
Then in your view page you can call the partial view liek this.
So going off your description if your are handling featured staff profiles I assume you are dealing with a list of IPublishedContent.
Your partial should look something like this.
Then your view might look something like this.
Hope this helps.
Thanks Dave, I still dont understand it 100% but i now have my Data passed in and displayed how i intended.
I have wrote a quick blog to help anyone else with the same issues as i had, Here is a link to my Blog : https://www.umbrajobs.com/blog/posts/2020/july/passing-objects-into-a-partial-view-with-umbraco-8/
It sounds like you are on the right track.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted