Copied to clipboard

Flag this post as spam?

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


  • JoskerVemeulen 67 posts 261 karma points
    Mar 08, 2019 @ 11:57
    JoskerVemeulen
    0

    Global Settings

    I have build a WebSiteConfig node on the same level as the Home node. It uses a document type where i can include headerScripts for instance.

    I want to use a partial view to insert this in my master template. Creating the partial view is no problem, but i can't seem to render the headerScripts on this partial view. Any ideas or examples?

    Using the inser value dropdown gives me:

    @Model.Value("headerScripts")

    But that Isn't working. That just displays nothing(no error).

    Any ideas?

  • Marcio Goularte 356 posts 1248 karma points
    Mar 08, 2019 @ 12:29
    Marcio Goularte
    0

    I believe it would render the property as html

    @Html.Raw(Model.Value("headerScripts"))
    
  • JoskerVemeulen 67 posts 261 karma points
    Mar 08, 2019 @ 13:31
    JoskerVemeulen
    0

    I would think so, but that don't work. If I print out my model on the partialview i get. Umbraco.Web.PublishedModels.Home

  • Frans de Jong 522 posts 1762 karma points c-trib
    Mar 09, 2019 @ 21:25
    Frans de Jong
    0

    Where did you place your partial? The partial will normally receive the model of the current page. So if you place the partial on the master template you'll need to specify your model.

    So something like @Html.Partial("somepartialpath",Umbraco.TypedContentSingleAtXPath("//websiteConfig"))

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies