Copied to clipboard

Flag this post as spam?

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


  • Simon 15 posts 85 karma points
    Feb 07, 2017 @ 08:27
    Simon
    0

    Show Content before template-data

    Hi

    I have a page with a template showing data from my server. In this same page I also have som static text which is edited in the Umbraco Backoffice content field.

    How can I get Umbraco so show the "content" text on top BEFORE the template data?

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Feb 07, 2017 @ 09:12
    Alex Skrypnyk
    0

    Hi Simon

    Can you show code how you render the page?

  • Simon 15 posts 85 karma points
    Feb 07, 2017 @ 09:41
    Simon
    0

    @using KASI.Mainsite.Website.Models.Customers
    @model KASI.Mainsite.Website.Models.ViewModels.CustomerAccountPageViewModel
    @{ Layout = "Master.cshtml"; }
    
    Kliniknavn:
    @Model.Stamdata.Institution
    Email:
    @if (!String.IsNullOrEmpty(Model.Stamdata.Email)) {
    @Model.Stamdata.Email
    } else {
    Ingen email udfyldt
    }
    Telefon:
    @Model.Stamdata.Telefon
    Adresse:
    @Model.Stamdata.Adresse
    Postnummer:
    @Model.Stamdata.Postnummer
    By:
    @Model.Stamdata.ByNavn
    @if (Model.Stamdata.SurveyDatas.Any()) {

        <dt class="stamdata-term">Survey dato:</dt>
        <dd>
            @foreach (var surveyData in Model.Stamdata.SurveyDatas.Take(1))
            {
                if (surveyData.Estim_Ugenummer > 0)
                {
                    <span>Uge:@surveyData.Estim_Ugenummer</span>
                    <span>År:@surveyData.Estim_Aar</span>
                }
                else
                {
                    <span>@surveyData.Estim_EksternSurvey.ToString("D")</span>
                }
            }
        </dd>
    }
    

    This is the code for the template.

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Feb 07, 2017 @ 10:06
    Alex Skrypnyk
    0

    Simon, do you want to show content before "Kliniknavn:"??

  • Simon 15 posts 85 karma points
    Feb 07, 2017 @ 10:23
    Simon
    0

    yes

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Feb 12, 2017 @ 22:29
    Alex Skrypnyk
    0

    Hi Simon

    Did you solve the issue?

    I would like to help you if not

    Thanks

    Alex

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Feb 07, 2017 @ 12:29
    Alex Skrypnyk
    0

    Hi Simon,

    Is it Umbraco page where you are using this code?

    Can you add

    @inherits Umbraco.Web.Mvc.UmbracoViewPage
    

    And then render content with this code:

    @Html.Raw(Umbraco.AssignedContentItem.GetPropertyValue("bodyText"))
    

    Where "bodyText" is alias of your content field.

    Thanks,

    Alex

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Feb 28, 2017 @ 13:45
    Alex Skrypnyk
    0

    Hi Simon,

    Did you find a way to do it?

    Thanks,

    Alex

  • Simon 15 posts 85 karma points
    Mar 01, 2017 @ 14:14
    Simon
    0

    Hi Alex, thanks for your answer. I will try your solution tomorrow.

Please Sign in or register to post replies

Write your reply to:

Draft