Hi, I'm looking for some help. I have currently created a template and have a partial loaded into it which gets some data from a set of child nodes. I'm wanting to use the same partial view again lower down but on the same page but have different child nodes which will mean the data show is different. The issue I have at the moment is I cant differentiate from the two partial. So the two partials are pulling in each others data. I want it so the first partial pulls in the first set of child nodes and the second one pulls in the second lot. How to i tell the item in the loop to only select the first batch ie partial 1? each partal is currently showing 8 child nodes where the first should just show 6 and the second should just show 2.
<div class="row" style="margin-top: 70px;">
@foreach (var item in currentPage)
{
@Html.Partial("~/Views/Partials/BlockSection.cshtml", item);
}
</div>
some html
<div class="row" style="margin-top: 70px;">
@foreach (var item in currentPage)
{
@Html.Partial("~/Views/Partials/BlockSection.cshtml", item);
}
</div>
Reuse Partial on same template
Hi, I'm looking for some help. I have currently created a template and have a partial loaded into it which gets some data from a set of child nodes. I'm wanting to use the same partial view again lower down but on the same page but have different child nodes which will mean the data show is different. The issue I have at the moment is I cant differentiate from the two partial. So the two partials are pulling in each others data. I want it so the first partial pulls in the first set of child nodes and the second one pulls in the second lot. How to i tell the item in the loop to only select the first batch ie partial 1? each partal is currently showing 8 child nodes where the first should just show 6 and the second should just show 2.
Hi Phil
How are you making the
currentPage
variable?Hi,
The below shows my currentPage.
Hi Phil
You can divide them into two seperate variables like this:
That works just how I needed it too. Thank you
is working on a reply...