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 have created some staff profile Doc Types and a Staff Folder of where to store them, But i am not to sure how I Display my content as a Partial View so I can Then Render them to the home page?
Any help or Advice would be great.
Hi Nathan,
I am assuming you have create a content item and using it as a folder to store the staff profiles? If so you can you it like this.
I have copied some of my code from another project so in this case I did it for specializations but essentially it should be the same.
List<Specialisation> specialisations = Umbraco.Content(1928).Children<Specialisation>().ToList();
So the Id is the id of the specialisations folder. In your case I am assuming this will be your staffProfilesFolder node Id.
@if (specialisations != null && specialisations.Count() > 0) { foreach (Specialisation specialisation in specialisations) { <div class="col-md-4 col-sm-6"> <div class="rounBox"> @if (specialisation.Icon != null) { @PropertyHelper.OptimizeImage(specialisation.Icon, Model.BaseViewModel.SiteSettings.EnableWebPimage, Model.BaseViewModel.SiteSettings.EnableLazyloadImages, specialisation.Title + " Icon", null, "imge1") } <h4>@specialisation.Title</h4> @if (specialisation.Link != null) { <a href="@specialisation.Link.Url" target="@specialisation.Link.Target"></a> } </div> </div> } }
Regards
David
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
How to Render Staff Profiles to the home page in Umbraco 8
I have created some staff profile Doc Types and a Staff Folder of where to store them, But i am not to sure how I Display my content as a Partial View so I can Then Render them to the home page?
Any help or Advice would be great.
Hi Nathan,
I am assuming you have create a content item and using it as a folder to store the staff profiles? If so you can you it like this.
I have copied some of my code from another project so in this case I did it for specializations but essentially it should be the same.
So the Id is the id of the specialisations folder. In your case I am assuming this will be your staffProfilesFolder node Id.
Regards
David
is working on a reply...