Copied to clipboard

Flag this post as spam?

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


  • kyle 49 posts 240 karma points
    Jun 23, 2022 @ 09:57
    kyle
    0

    Doc type for master template

    Hi all,

    I have to make a few changes to an old Umbraco site (Umbraco v6.1.5 (Assembly version: 1.0.4993.19246)) and I'm having a hard time :(

    The footer section of the site is not editable, so my task is to utilize the CMS to make the footer editable. But how do I go about doing this? I can't have a doctype for the master template because the content will always be related to the current page... Compositions are not an option because it's not supported in v6... So I don't know what to do.

    On my Umbraco v8 website I did this in the master template.

         var rootModel = Model.Root();
    <p>@rootModel.Value("value")</p>
    

    and it works 100%. But I can't seem to do this on the v6 site, I think it's because the site is based on web forms and not MVC.

    Any solution/ suggestion would be appreciated, this has been a pain for me...

    Thanks - Kyle

  • girish 6 posts 78 karma points
    Jun 23, 2022 @ 14:22
    girish
    1

    Hi kyle,

    You can try with the below code.

    var home = Model.Content.AncestorOrSelf(1);
    var textValue = home.GetPropertyValue<string>("value");
    
    <p>@textValue </p>
    
  • kyle 49 posts 240 karma points
    Jun 23, 2022 @ 14:36
    kyle
    0

    Just tried it... The website breaks and gives a parse error when adding the '@'

    @{
    var home = Model.Content.AncestorOrSelf(1);
    }
    
Please Sign in or register to post replies

Write your reply to:

Draft