Copied to clipboard

Flag this post as spam?

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


  • Dan Evans 629 posts 1016 karma points
    Jul 01, 2015 @ 09:58
    Dan Evans
    0

    Multiple items on a page

    I have the following code which inserts a button(s) on a page. It works fine for the first set but if another set it added lower down the page there is an error thrown:

    The value of parameter 'id' must be either a string or an integer

    @inherits UmbracoViewPage

    @if (Model.Items.Any()) { foreach (var item in Model.Items) {

            if (item.GetValue("buttonLink") != ""){
            var node = Umbraco.Content(item.GetValue("buttonLink"));
    
            <section class="socials-block container">
                <div class="btn-holder">
                    <a href="@node.Url" class="btn-action"><span>@item.GetValue("buttonText")</span></a>
                </div>
            </section>
            }   
                }   
    

    }

Please Sign in or register to post replies

Write your reply to:

Draft