Copied to clipboard

Flag this post as spam?

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


  • Jack Taylor 16 posts 107 karma points
    Jul 27, 2022 @ 15:50
    Jack Taylor
    0

    Macro numeric parameter returning zero

    I've created a macro for the rich text editor, I have a width and height numeric parameter, I've set the values in the content node, I've double checked the field names are correct. However numeric parameter is returning "0" when it should be returning the values that have been entered into the macro parameter.

    See my code below:

    @inherits Umbraco.Cms.Web.Common.Macros.PartialViewMacroPage
    @using Umbraco.Cms.Core.Models;
    @{
        var frameUrl = Model.GetParameterValue<string>("frameUrl");
        var frameTitle = Model.GetParameterValue<string>("frameTitle");
        var frameHeight = Model.GetParameterValue<int>("frameHeight");
        var frameWidth = Model.GetParameterValue<int>("frameWidth");
    }
    <iframe class="iframe-macro" height="@frameHeight" width="@frameWidth" src="@frameUrl" title="@frameTitle"></iframe>
    

    Can anyone help me understand how I can load the correct value that's been entered for the numeric parameter?

    Thanks

Please Sign in or register to post replies

Write your reply to:

Draft