I have a "Nested Content" component which has "Min Items & Max Items" set to 3, I then have a "Related Links" component within that which has max items set to 1. However when i go to add that one link, I do not see the add option. (see below)
If i amend my "Related Links" to be max items 3, i see the option to add a link. If so do this, it would allow three items to be created per item in the nested content am i right? I would like the ability for only one item to be created per item in the nested content. Is there something I am doing wrong?
On another note, rendering I am not sure on how I will go about rendering the related links in the view.
This is what I have so far:
@{
var items = Model.Content.GetPropertyValue<IEnumerable<IPublishedContent>>("whyChooseSummit");
foreach (var reason in items)
{
<div class="feature">
<img src="/Content/images/logo-bullet-white.png" alt="Summit Law LLP" />
<div class="reason">
<h4 class="blue-text">
@*@reason.GetPropertyValue<RelatedLinks>("reasonTitle")>*@
</h4>
<p>@reason.GetPropertyValue("reason")</p>
</div>
</div>
}
}
The "reasonTitle" property is the related links. Does anything know what I need to put to only pull through that one related link per nested content item?
I am not to sure about the first one, I am just thinking out loud now. Do you maybe get an error in the console? Maybe try switching position so that the related link is in the bottom, have you tired creating it outside the nested content? Maybe try to recreate it as a data type?
As for your code, by adding @using Umbraco.Web.Models
to the top of the view should make the code work.
Related Links within Nested Content
Could anyone help with the following:
I have a "Nested Content" component which has "Min Items & Max Items" set to 3, I then have a "Related Links" component within that which has max items set to 1. However when i go to add that one link, I do not see the add option. (see below)
If i amend my "Related Links" to be max items 3, i see the option to add a link. If so do this, it would allow three items to be created per item in the nested content am i right? I would like the ability for only one item to be created per item in the nested content. Is there something I am doing wrong?
On another note, rendering I am not sure on how I will go about rendering the related links in the view.
This is what I have so far:
The "reasonTitle" property is the related links. Does anything know what I need to put to only pull through that one related link per nested content item?
Hi David,
I am not to sure about the first one, I am just thinking out loud now. Do you maybe get an error in the console? Maybe try switching position so that the related link is in the bottom, have you tired creating it outside the nested content? Maybe try to recreate it as a data type?
As for your code, by adding
@using Umbraco.Web.Models
to the top of the view should make the code work.Here is the documentation for Related Links
https://our.umbraco.com/Documentation/Getting-Started/Backoffice/Property-Editors/Built-in-Property-Editors/Related-Links2
//Johannes
is working on a reply...