How to create dynamic footer link using related links document type in Umbraco 7
Hi, I am noobie.
I am trying to crate dynamic footer links for my website using related link document type. I created a footer partail view and call the realted link document type in the partial view and on masterlayout i have called the partial view but this documetn type is only displayed on the home page, I want these links to appear on all the pages of my website.
here is my partail view code.
@inherits UmbracoTemplatePage
@using Newtonsoft.Json.Linq
@{
if (Model.Content.HasValue("whoWeDoItFor"))
{
<ul >
@{
var dynamicLinks = Model.Content.AncestorOrSelf("whoWeDoItFor");
//var x = Model.Content.GetPropertyValue<string>("whoWeDoItFor");
var Links = Model.Content.GetPropertyValue<JArray>("whoWeDoItFor");
<li>
<div>
@if (Links.Any())
{
<ul>
@foreach (var linkItem in Links)
{
var linkUrl = (linkItem.Value<bool>("isInternal")) ? Umbraco.NiceUrl(linkItem.Value<int>("internal")) : linkItem.Value<string>("link");
var linkTarget = linkItem.Value<bool>("newWindow") ? "_blank" : null;
<li><a href="@linkUrl" target="@linkTarget">@(linkItem.Value<string>("caption"))</a></li>
}
</ul>
}
</div>
</li>
}
</ul>
}
}
Please help me, how I can make these links to appear on all the web pages
How to create dynamic footer link using related links document type in Umbraco 7
Hi, I am noobie.
I am trying to crate dynamic footer links for my website using related link document type. I created a footer partail view and call the realted link document type in the partial view and on masterlayout i have called the partial view but this documetn type is only displayed on the home page, I want these links to appear on all the pages of my website.
here is my partail view code.
Please help me, how I can make these links to appear on all the web pages
Hi Abdul,
Try this code instead:
You can find the documentation for the related links property editor here: http://our.umbraco.org/documentation/Using-Umbraco/Backoffice-Overview/Property-Editors/Built-in-Property-Editors-v7/Related-Links In my example I assume that your alias of the property is: whoWeDoItFor. And I have added the property on my home document type.
Hope this helps,
/Dennis
Hi Denis,
Thanks alot, It worked!! :)
Cheers
is working on a reply...