Copied to clipboard

Flag this post as spam?

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


  • Rasmus Fjord 675 posts 1566 karma points c-trib
    Feb 15, 2012 @ 12:24
    Rasmus Fjord
    0

    Simple parameter parsing from template to macro not working

    Hey

    I have created a simple macro with 4 parameters to be used in my templates.

    param alias' (all are of property text) are :

    path

    width

    height

    alt

    im my template it looks like this :

    <umbraco:Macro path="[#highlightImage]" width="11" height="11" alt="11" Alias="ImagegenInserter" runat="server">umbraco:Macro>

    and in my macro it looks like this

    @{

    var item = Model.MediaById(@Parameter.path);
    <img src="/[email protected]&[email protected]&[email protected]&Constrain=false" alt="@Parameter.alt" />
    }

    When loading the page i get the path and alt text out, but not the height and width(11 is just a test value ofc).

    So the html looks like this :

    11

    Any ideas ?

     


     

  • Rasmus Fjord 675 posts 1566 karma points c-trib
    Feb 15, 2012 @ 12:50
    Rasmus Fjord
    0

    sry it does not come out as " 11 " but

    <img alt="tekst" src="/ImageGen.ashx?image=/media/59/P5010907.JPG&amp;width=&amp;height=&amp;Constrain=false&amp;Crop=resize">

     

  • Rasmus Fjord 675 posts 1566 karma points c-trib
    Feb 15, 2012 @ 13:13
    Rasmus Fjord
    0

    Apparently it wouldnt make me use "width" and "height" as parameter alias'

    works if i rename them w and h

Please Sign in or register to post replies

Write your reply to:

Draft