Copied to clipboard

Flag this post as spam?

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


  • Sunil 14 posts 84 karma points
    Feb 24, 2020 @ 13:50
    Sunil
    0

    How to make Header and Footer Dynamic

    Hi,

    I have umbraco master page and created two partial views named "Header.cshtml" and "Footer.Html" and calling these partial views in master page that have dynamic menu functionality as well that have a separate model. Now i am facing issues in making header and footer content dynamic. Header partial view is:`@using Website.Models; @using Umbraco.Core.Models; @inherits Umbraco.Web.Mvc.UmbracoViewPage<>

    --This line needs to be dynamic
    @RenderSubItems(Model)

    @helper RenderSubItems(List

        foreach (var item in listItems)
        {
    
            <a class="hlinks" href="@item.Link.Url" target="@item.Link.Target">@item.Link.Text</a>
    
    
            if (item.HasSubNavigation)
            {
                @RenderSubItems(item.NavItems)
            }
        }
    }
    

    } Master Page is:@inherits Umbraco.Web.Mvc.UmbracoViewPage @{ Layout = null; }

    <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>

        @{
            Html.RenderAction("RenderHeader", "Layout");
        }
        @RenderBody()
    
        @{
            Html.RenderAction("RenderFooter", "Layout");
        }
    </div>
    

    Footer Partial view is

        <div class="s-12 m-9 l-3 padding-2x margin-bottom background-dark">
            <h2 class="text-strong text-uppercase">Who We Are?</h2>
            <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy.</p>
        </div>
    
    
        <div class="s-12 m-9 l-3 padding-2x margin-bottom background-dark">
            <h2 class="text-strong text-uppercase">Contact Us</h2>
            <p><b class="text-primary margin-right-10">P</b> 0800 4521 800 50</p>
            <p><b class="text-primary margin-right-10">M</b> <a class="text-primary-hover" href="mailto:[email protected]">[email protected]</a></p>
            <p><b class="text-primary margin-right-10">M</b> <a class="text-primary-hover" href="mailto:[email protected]">[email protected]</a></p>
        </div>
        <!-- Footer - bottom -->
        <div class="s-12 text-center margin-bottom">
            <p class="text-size-12">Copyright 2019, Vision Design - graphic zoo</p>
            <p class="text-size-12">All images have been purchased from Bigstock. Do not use the images in your website.</p>
            <p><a class="text-size-12 text-primary-hover" href="http://www.myresponsee.com" title="Responsee - lightweight responsive framework">Design and coding by Responsee Team</a></p>
        </div>
    </footer>`
    
Please Sign in or register to post replies

Write your reply to:

Draft