Copied to clipboard

Flag this post as spam?

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


  • Stephen 94 posts 255 karma points
    Aug 12, 2014 @ 17:50
    Stephen
    0

    GetCropUrl in Razor / Using Crops in the Rich Editor.

    Hi All,

    I know how to use GetCropUrl with MCV (currentPage).  But I can't find out how to use GetCropUrl with Razor (Model).

    Please help because I have finally found something where I can't how not to use Razor.

    Otherwise please tell me how I can call a Partial view from Razor easilly.

    Basically I am inserting a Macro into the Rich editor, so I can used cropped inmages in the Rich editor.  So If someone has an even slicker way of doing that than great thanks.

    Thanks

    Stephen

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Aug 12, 2014 @ 17:56
    Jeavon Leopold
    100

    Hi Stephen,

    Your macro should be a Partial View Macro, then you have CurrentPage and can do what you already know with GetCropUrl

    "Razor Macro" are legacy only and shouldn't generally be used.

    Does that make sense?

    Jeavon

  • Stephen 94 posts 255 karma points
    Aug 14, 2014 @ 01:47
    Stephen
    0

    Hi Jeavon,

    Perfect, thanks.

    All sorted now.

    Took me a little time to work out how to pull parameters, and the whole Model bit threw me, but this worked for me (note Square bracket)

    @Model.MacroParameters["Image"]

    Hopefully anyone else reading this, saves them a few mins.

    Thanks

    Stephen

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Aug 14, 2014 @ 13:48
    Jeavon Leopold
    0

    Fantastic!

Please Sign in or register to post replies

Write your reply to:

Draft