Copied to clipboard

Flag this post as spam?

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


  • Dallas 133 posts 405 karma points
    Mar 30, 2013 @ 20:08
    Dallas
    0

    Partial View Macros in 4.11

    Are Partial View Macros supported in 4.11.?

    The Macro editor screen has an entry for them, but it doesn't seem to work. It doesn't list the files in the partials folder, and if you manually enter a file it is saved as a script file.

    Is there a work around to use a Partial View Macro?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 30, 2013 @ 20:25
    Jan Skovgaard
    0

    Hi Dallas

    Are you running MVC mode or webforms mode?

    /Jan

  • Dallas 133 posts 405 karma points
    Mar 31, 2013 @ 00:41
    Dallas
    0

    Jan, the site is running in MVC mode.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 31, 2013 @ 11:12
    Jan Skovgaard
    0

    Hi Dallas

    Ok, then I think it should display just fine. What is the exact 4.11 version you're using? I'm thinking wheter it's 4.11.3 for instance.

    Have you double checked that permisions have been set correctly? Do you see any errors messages in the browser console when trying to see them?

    Looking forward to hearing from you.

    /Jan

  • Charles Afford 1163 posts 1709 karma points
    Apr 01, 2013 @ 12:44
    Charles Afford
    0

    Hi, i might have the wrong thing here, but i am using 4.11.4 and it works for me?

    In the macros folder i have my partial views.  If i click on one i can see 

    Name

    Alias

    Use MVC Partial View -- From the drop down i can choose the files located at ~/Views/MacroPartials.

    (I am creating my partials and views in visual studio by opening the my wwwroot soloution as a website :).

    Hope this helps :).  Charlie.


     


  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Apr 01, 2013 @ 12:54
    Matt Brailsford
    1

    Hi Dallas,

    It should work, but I'm guessing, based on this line in your questions "It doesn't list the files in the partials folder", you may be getting confused with Partials and MacroPartials. 

    Partials inherit from Umbraco.Web.Mvc.UmbracoTemplatePage and are located in ~/Views/Partials. Macro partials on the other hand inherit from Umbraco.Web.Macros.PartialViewMacroPage and are located in ~/Views/MacroPartials. If you want to create a macro partial, then you'll need to make sure you are using the later method.

    Hope that helps

    Matt

  • Dallas 133 posts 405 karma points
    Apr 04, 2013 @ 17:04
    Dallas
    100

    Thanks all for confirming that MacroPartials do work. Matt, you are correct I had confused Partials and MacroPartials. I was thinking of Macro Partials as being normal partials that are chosen as a Macro.

    The MacroPartials folder should have been an obvious clue! However I will add that the Macro edit screen label is 'Use MVC Partial View', and the dropdown label is 'Browse partial view files on server..'

    Thanks

    Dallas

  • Dallas 133 posts 405 karma points
    Apr 04, 2013 @ 17:06
    Dallas
    0

    Matt, I accidentally clicked the 'solved' icon on my response and not your answer. Is there a way to change that?

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Apr 04, 2013 @ 17:07
    Matt Brailsford
    0

    Hey Dallas,

    lol, not without asking HQ to fix it :)

    Don't worry about it, enjoy the karma and glad you got it working.

    Matt

Please Sign in or register to post replies

Write your reply to:

Draft