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
Hi
In the code below i need it to +1 on every children on data-slide-index="0".
Starting at 0 and then 1,2,3,4,5
@foreach (var image in @Model.Children){foreach (dynamic d in image.imageDampSingle){<a data-slide-index="0" href="@DAMP_Helper.GetImageCropperUrl(d, "projectSingle")"><img src="@DAMP_Helper.GetImageCropperUrl(d, "projectSingleThumb")" title="@Model.captionText" alt="@d.Image.nodeName" /></a>
Thanks in advance!
Kind regards
René
Hi,
Use the property Position
@foreach(var image in@Model.Children){foreach(dynamic d in image.imageDampSingle){<a data-slide-index="@d.Position" href="@DAMP_Helper.GetImageCropperUrl(d, "projectSingle")"><img src="@DAMP_Helper.GetImageCropperUrl(d, "projectSingleThumb")" title="@Model.captionText" alt="@d.Image.nodeName"/></a>
Hi Marcio
I have just tried that with no luck. Am I missing something?
I was thinking something like this.
int theCount = 0;theCount += 1; // Adds 1 to count
But I dont know how to use it correctly in the code.
Hi René
Could you try this one:
@foreach(var image in Model.Children){foreach(dynamic d in image.imageDampSingle){<a data-slide-index="@d.Position()" href="@DAMP_Helper.GetImageCropperUrl(d, "projectSingle")"><img src="@DAMP_Helper.GetImageCropperUrl(d, "projectSingleThumb")" title="@Model.captionText" alt="@d.Image.nodeName"/>a>
/Dennis
Hi Dennis
Unfortunately that did not work either. Someone asked me if it could be made by using recursion. Does that mean anything to you?
// René
I finally found a solution myself. See below:
@{var countNum = -1;}@foreach (var image in @Model.Children){ { countNum += 1; } foreach (dynamic d in image.imageDampSingle) { <a data-slide-index="@countNum" href="@DAMP_Helper.GetImageCropperUrl(d, "projectSingle")"><img src="@DAMP_Helper.GetImageCropperUrl(d, "projectSingleThumb")" title="@Model.captionText" alt="@d.Image.nodeName" /></a> }}
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
On every children +1 (count)
Hi
In the code below i need it to +1 on every children on data-slide-index="0".
Starting at 0 and then 1,2,3,4,5
Thanks in advance!
Kind regards
René
Hi,
Use the property Position
Hi Marcio
I have just tried that with no luck. Am I missing something?
René
I was thinking something like this.
int theCount = 0;
theCount += 1; // Adds 1 to count
But I dont know how to use it correctly in the code.
Hi René
Could you try this one:
/Dennis
Hi Dennis
Unfortunately that did not work either. Someone asked me if it could be made by using recursion. Does that mean anything to you?
// René
I finally found a solution myself. See below:
// René
is working on a reply...