Copied to clipboard

Flag this post as spam?

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


  • mikkel 105 posts 297 karma points
    Feb 09, 2019 @ 14:58
    mikkel
    0

    footer text just won't show up. What can I do

    Hi. I am starting the footer section on my website. There is a text and social icons. When I use @ Umbraco.Field ("") the text will appear on the front page but not the rest of the pages. It is even though it is on my master page. I have tried to make only a doctype without template and I have tried to do a doctype with template. I have also tried to make a partial view. No matter what I do, the footer text only appears on the front page.

    what to do :D

    Here is my masterpage

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    @using ContentModels = Umbraco.Web.PublishedContentModels;
    @{
        Layout = null;
    }
    <!DOCTYPE html>
    <html lang="da" xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <meta name="title" content="@Umbraco.Field("seoTitel")">
        <meta name="description" content="@Umbraco.Field("seoBeskrivelse")">
        <meta name="author" content="@Umbraco.Field("creatorName")">
        <title>@Umbraco.Field("pageName")</title>
    
        <!-- Bootstrap core CSS -->
        <link href="~/css/bootstrap.min.css" rel="stylesheet">
    
    
        <!-- Custom fonts for this template -->
        <link href="~/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
        <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
        <link href='https://fonts.googleapis.com/css?family=Kaushan+Script' rel='stylesheet' type='text/css'>
        <link href='https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
        <link href='https://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700' rel='stylesheet' type='text/css'>
    
    
    
    
    
        <!-- Custom styles for this template -->
        <link href="~/css/agency.min.css" rel="stylesheet">
        <link href="~/css/kontakt-form.css" rel="stylesheet" />
        <link href="~/css/default.css" rel="stylesheet" />
    
    
    
    </head>
    
    <body id="page-top">
        <!-- Navigation -->
        <nav class="navbar navbar-expand-lg navbar-dark fixed-top" id="mainNav">
            <div class="container">
                <a class="navbar-brand js-scroll-trigger" href="/">WebManden</a>
                <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
                    Menu
                    <i class="fas fa-bars"></i>
                </button>
                <div class="collapse navbar-collapse" id="navbarResponsive">
                    @{
                        var selection = Model.Content.Site().Children()
                                                        .Where(x => x.IsVisible());
                    }
                    <ul class="navbar-nav text-uppercase ml-auto">
                        @foreach (var item in selection)
                        {
                            <li class="nav-item">
                                <a href="@item.Url" class="nav-link js-scroll-trigger">@item.Name</a>
                            </li>
                        }
    
                    </ul>
                </div>
            </div>
        </nav><div id="content-placeholder">
            @RenderBody()
        </div>
    
      <!-- Footer -->
      <footer>
        <div class="container">
          <div class="row">
            <div class="col-md-4">
              <span class="copyright">@Umbraco.Field("footerText")</span>
            </div>
            <div class="col-md-4">
              <ul class="list-inline social-buttons">
                <li class="list-inline-item">
                  <a href="#">
                    <i class="fab fa-twitter"></i>
                  </a>
                </li>
                <li class="list-inline-item">
                  <a href="#">
                    <i class="fab fa-facebook-f"></i>
                  </a>
                </li>
                <li class="list-inline-item">
                  <a href="#">
                    <i class="fab fa-linkedin-in"></i>
                  </a>
                </li>
              </ul>
            </div>
            <div class="col-md-4">
              <ul class="list-inline quicklinks">
                <li class="list-inline-item">
                  <a href="#">Privacy Policy</a>
                </li>
                <li class="list-inline-item">
                  <a href="#">Terms of Use</a>
                </li>
              </ul>
            </div>
          </div>
        </div>
      </footer>
    
    
    
    
    
        <!-- Bootstrap core JavaScript -->
        <script src="~/Scripts/theme-js/jquery.min.js"></script>
        <script src="~/Scripts/theme-js/bootstrap.bundle.min.js"></script>
    
        <!-- Plugin JavaScript -->
        <script src="~/Scripts/theme-js/jquery.easing.min.js"></script>
        <!-- Contact form JavaScript -->
        <script src="~/Scripts/theme-js/jqBootstrapValidation.js"></script>
        <script src="js/contact_me.js"></script>
    
        <!-- Custom scripts for this template -->
        <script src="~/Scripts/theme-js/agency.js"></script>
        <script src="~/Scripts/theme-js/agency.min.js"></script>
    </body>
    
    </html>
    
  • Kevin Jump 1348 posts 8385 karma points MVP 2x c-trib
    Feb 09, 2019 @ 15:28
    Kevin Jump
    100

    Hi,

    When using @Umbraco.Field the template will look for the values on the current page it is rendering - so the values will be blank if they are only on the homepage.

    you can get the page to recurse up the content tree (so look at parent pages for the values) by passing the recursive property. (see docs here)

    e.g

    @Umbraco.Field("footerText", recursive: true)
    

    that should make the values appear on all the pages.

  • mikkel 105 posts 297 karma points
    Feb 09, 2019 @ 16:35
    mikkel
    0

    thanks for the help :D it works fine now :D

Please Sign in or register to post replies

Write your reply to:

Draft