Bringing up a new site in U 7.2.1 (my first under U7, but not my first Umbraco site) and I'm a bit confused. I've built several sites under u4/6 and have been using razor for quite some time but I'm at a loss with it under U7.
When I go to the developer section, I don't see a top-level directory for Scripting Files folder for my razor scripts. The Macro's section still has the option razor script under "choose a file to render", but I'm not sure where its pointing to.
Did I just mis something in the (admittedly lightly skimmed) release notes where it says where I should be putting my razor scripts, did it totally get depreciated for the partial views, or do I just have a borked installtion that is missing something?
Can someone point me in the right direction, please?
The reason why you don´t see the a top-level directory for Scripting Files, is becuase it was for the old dynamicNode razor files, and the dynamicNode Razor is an old legacy razor implementation, and it´s is deprecated. Instead you should use partial views or partial view macros
Thank you Dennis for your post! I have also searched the entire world wide web (feels like it) to find info on this subject. I do think the official sources have been vague in providing a clear statement of what was happening with Razor vs. Partial Views...
Hey, couldn't understand where I can find the "old" scripts in order to create the new ones under the MVC macros? Is there any guide? Like, where can I find the "old" code? After creating the new scrips - should I delete the old scripts?
Razor in U7...Am I just over tired?
Hey everyone,
Bringing up a new site in U 7.2.1 (my first under U7, but not my first Umbraco site) and I'm a bit confused. I've built several sites under u4/6 and have been using razor for quite some time but I'm at a loss with it under U7.
When I go to the developer section, I don't see a top-level directory for Scripting Files folder for my razor scripts. The Macro's section still has the option razor script under "choose a file to render", but I'm not sure where its pointing to.
Did I just mis something in the (admittedly lightly skimmed) release notes where it says where I should be putting my razor scripts, did it totally get depreciated for the partial views, or do I just have a borked installtion that is missing something?
Can someone point me in the right direction, please?
Thank you in advance,
Rick
Hi Rick,
The reason why you don´t see the a top-level directory for Scripting Files, is becuase it was for the old dynamicNode razor files, and the dynamicNode Razor is an old legacy razor implementation, and it´s is deprecated. Instead you should use partial views or partial view macros
And you can use the dynmaic version of Razor or the strongly typed version. You can read more about the dynamic version here http://our.umbraco.org/documentation/Reference/Templating/Mvc/views#Renderingafieldusing@CurrentPage%28dynamically%29, and about the strongly typed Razor here: http://our.umbraco.org/documentation/Reference/Mvc/partial-views#StronglytypedPartialViews
So when you are using the Umbraco 7.2.1 you need to convert your old dynamicNode razor scripts to partial views or partial view macros. It is not so hard to convert it. the @Model, is @CurrentPage in the dynamic Razor and in the stongly typed version @Model is @Model.Content. you can see more about converting legacy Razor MacroScript to partial view macros here http://our.umbraco.org/documentation/reference/templating/macros/Partial-View-Macros/#ConvertingaPartialViewMacrofromalegacyRazorMacroScript
So your installation is not missing the Scripting Files folder.
Hope this can throw some light on why Scripting Files folder is not there any more.
/Dennis
Dennis,
Thank you for pointing me in the right direction! I don't care to admit how long I crawled through my installation wondering what I did wrong...
Rick
Thank you Dennis for your post! I have also searched the entire world wide web (feels like it) to find info on this subject. I do think the official sources have been vague in providing a clear statement of what was happening with Razor vs. Partial Views...
So you just saved my day :D
thanks for the guidance :)
Hey, couldn't understand where I can find the "old" scripts in order to create the new ones under the MVC macros? Is there any guide? Like, where can I find the "old" code? After creating the new scrips - should I delete the old scripts?
is working on a reply...