U4-5441 - [Feature Request] 7.2 Partial Views and Partial View Macro's should allow for folder hierarchy

Created by Jeremy Pyne 04 Sep 2014, 17:01:27 Updated by Sebastiaan Janssen 21 Jan 2015, 16:05:42

Is duplicated by: U4-2151

Is duplicated by: U4-5183

Is duplicated by: U4-5659

Is duplicated by: U4-6160

Relates to: U4-5959

Relates to: U4-1651

Relates to: U4-5183

Partial Views and Partial View Macro's should allow for folder hierarchy for organization. This changes makes them work much like the Scripts and css folders.

I didn't add a Type drop down like the scripts screen has. This is unnecessary and cumbersome. Instead it works like other screens and the user can generate a hierarchy in their files by adding /'s in the names. This is how it works in Stylesheets works and its a lot cleaner. I added a note of this to the creation dialogs as well.

For example create a view file with the name myFolder/myView and the system will take care of folder creation automatically. There is also a delete option.

1 Attachments


Jeremy Pyne 04 Sep 2014, 20:10:34

Patch available at https://github.com/umbraco/Umbraco-CMS/pull/470

Shannon Deminick 05 Sep 2014, 00:00:26

This is great (just wish we had upgraded those trees to be the new v7 format so we didn't have to muck around with the create.ui file thing)... if i get this pulled in I'll hopefully have time to upgrade those trees so we don't require that change.

The other thing that needs testing is rendering these partial views and partial view macros since the view engine that looks for partial views and partial view macros doesn't look in sub folders. Not sure if you've tested all of that ? Partial view macros can be dealt with by specifying the full path (it might actually do this already, not sure), but partial views will also need to be rendered with their full path, or a relative path (I'm not sure if that works ootb with how view engines are currently setup).

Jeremy Pyne 05 Sep 2014, 01:53:49

I guess I'm not sure what your referring to. Partial views work as expected with the following code:

@Html.Partial("uBlogsy/Widgets/uBlogsyWidgetShowRSSLink", Model)

Macors also work with drop down as expected as they are automatically fully patched as "~/Views/MacroPartials/Tracking/LeadAnywhere.cshtml" by the gui.

I haven't tested any controller-views but those go into their own folders in the root so they wouldn't be included. Not sure maybe theres a use case i am missing.

Shannon Deminick 05 Sep 2014, 01:55:55

Cool, that's what i was unsure of as to whether the view engines support that syntax:

@Html.Partial("uBlogsy/Widgets/uBlogsyWidgetShowRSSLink", Model)

so i guess it does which is cool.

Shannon Deminick 22 Oct 2014, 05:47:45

There was quite a lot of underlying stuff that actually had to be fixed up for this to work nicely everywhere. Not really much to do with your PR, just stuff to do with our core. Here's the commit which fixes it all: 86e82c76740b207d8c172416e8e27874f18595b4

Carlos 20 Jan 2015, 21:01:29

@Shandem So this release is in Umbraco 7.2.1? Is this correct? This is what I gleamed from the commit.

Shannon Deminick 20 Jan 2015, 22:12:40

This issue says it's flagged for 7.2.0 release so I'm going to assume the feature is in 7.2.1 - I unfortunately can't remember every issue i solve ;)

Priority: Normal

Type: Feature (request)

State: Fixed

Assignee: Shannon Deminick

Difficulty: Normal

Category: Editor

Backwards Compatible: True

Fix Submitted: Pull request

Affected versions: 7.2.0

Due in version: 7.2.0


Story Points: