Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Chris Legg 1 post 71 karma points
    Feb 10, 2016 @ 15:22
    Chris Legg
    0

    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) {

    House insurance i==2

    @BlockItems.Name

    @BlockItems.BodyText @{ var BlockLinks = BlockItems.singlelink; foreach(var Link in BlockLinks) {
    Get Quote
    if (!BlockItems.addQuoteButton) { } } }

    } else { i++;

    House insurance 1++

    @BlockItems.Name

    @BlockItems.BodyText @{ var BlockLinks = BlockItems.singlelink; foreach(var Link in BlockLinks) {
    Get Quote
    if (!BlockItems.addQuoteButton) { } } }

    }

    } } 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) {

    Home insurance i2

    @BlockItems.Name

    @BlockItems.BodyText @{ var BlockLinks = BlockItems.singlelink; foreach(var Link in BlockLinks) { if (BlockItems.addQuoteButton) {
    Get Quote
    } } }

    } else { i++;

    REMOVE?

    @BlockItems.Name

    @BlockItems.BodyText @{ var BlockLinks = BlockItems.singlelink; foreach(var Link in BlockLinks) {
    Get Quote
    if (!BlockItems.addQuoteButton) { } } }

    }

    } } else { foreach(var BlockItems in Block) { if (i==2) {

    Car insurance

    @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++;

    Home Insurance 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) {
    Get Quote
    } } }

    }

    } } }

    icon duplication

    THANKS IN ADVANCE!!!

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies