I have three boxed sections, the Home / Travel / Car boxes through the code it is duplicating the icon, I am unsure how to fix this can you spread any light on it for me? seems to be i==2 / or i++ which is creating two of the same instance of icon!?
I have attached a image of the issue and code underneath.
CODE
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@{
var Block = CurrentPage.AncestorOrSelf(1).Descendants("Blocks");
//var Block = Model.Content.Children.Where(c => c.DocumentTypeAlias.Equals("Blocks"));
var i = 0;
var urlPath = Request.Url.AbsoluteUri.ToLower();
if(urlPath.Contains("unite"))
{
foreach(var BlockItems in Block) {
if (i==2) {
@BlockItems.Name
@BlockItems.BodyText
@{
var BlockLinks = BlockItems.singlelink;
foreach(var Link in BlockLinks) {
if (!BlockItems.addQuoteButton) {
}
}
}
} else {
i++;
@BlockItems.Name
@BlockItems.BodyText
@{
var BlockLinks = BlockItems.singlelink;
foreach(var Link in BlockLinks) {
@BlockItems.BodyText
@{
var BlockLinks = BlockItems.singlelink;
foreach(var Link in BlockLinks) {
if (BlockItems.addQuoteButton) {
}
}
}
} else {
i++;
@BlockItems.Name
@BlockItems.BodyText
@{
var BlockLinks = BlockItems.singlelink;
foreach(var Link in BlockLinks) {
if (!BlockItems.addQuoteButton) {
}
}
}
}
}
}
else
{
foreach(var BlockItems in Block) {
if (i==2) {
@BlockItems.Name
@BlockItems.BodyText
@{
var BlockLinks = BlockItems.singlelink;
foreach(var Link in BlockLinks) {
var linkUrl = Link.Url;
var linkBox = linkUrl.Remove(linkUrl.Length -1);
if (BlockItems.addQuoteButton) {
}
}
}
} else {
i++;
@BlockItems.Name
@BlockItems.BodyText
@{
var BlockLinks = BlockItems.singlelink;
foreach(var Link in BlockLinks) {
var linkUrl = Link.Url;
var linkBox = linkUrl.Remove(linkUrl.Length -1);
if (BlockItems.addQuoteButton) {
Icon Duplication i==2
Hi Forum,
I have three boxed sections, the Home / Travel / Car boxes through the code it is duplicating the icon, I am unsure how to fix this can you spread any light on it for me? seems to be i==2 / or i++ which is creating two of the same instance of icon!?
I have attached a image of the issue and code underneath.
CODE
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@{
var Block = CurrentPage.AncestorOrSelf(1).Descendants("Blocks"); //var Block = Model.Content.Children.Where(c => c.DocumentTypeAlias.Equals("Blocks")); var i = 0; var urlPath = Request.Url.AbsoluteUri.ToLower();
if(urlPath.Contains("unite")) { foreach(var BlockItems in Block) { if (i==2) {
@BlockItems.Name
} else { i++;
@BlockItems.Name
}
} } else if(urlPath.Contains("unison") || urlPath.Contains("cwu") || urlPath.Contains("usdaw") || urlPath.Contains("nasuwt") || urlPath.Contains("rmt") || urlPath.Contains("fbu") || urlPath.Contains("gmb")) { foreach(var BlockItems in Block) { if (i==2) {
@BlockItems.Name
} else { i++;
@BlockItems.Name
}
} } else { foreach(var BlockItems in Block) { if (i==2) {
@BlockItems.Name
} else { i++;
@BlockItems.Name
}
} } }
THANKS IN ADVANCE!!!
is working on a reply...