1) Yes, just do the same, but with a dot instead of a colen - umbraco.library.NiceUrl(nodeId);
2) What works best for you is best. Personally, I like seperating concerns and most work in external cshtml files and with helpers that get put into App_Code
3) Yes. You can add references in web.config (compilation / assemblies). For more intellisense add an @using umbraco.MacroEngines; and cast Model to a DynamicNode
4) Because a macro is not a razor template :-) Razor templates are built in. Macros are blocks of functionality that you create yourself.
Razor and template/umbraco lib/Visual Studio...
Hi,
I'm testing Razor in 4.7RC and I've some questions.
1) In Razor template is possibile to use Umbraco Library as into XSTL?
2) Is the best solution to use macro or razor script into template?
3) How is possible to write code with Vs2010 and put into Umbraco without DLL, but use Vs2010 intellisense and reference to Umbraco Libraries?
4) Template toolbar: Razor macros are listed in macro button and not in Razor template button. Why?
Thank you
1) Yes, just do the same, but with a dot instead of a colen - umbraco.library.NiceUrl(nodeId);
2) What works best for you is best. Personally, I like seperating concerns and most work in external cshtml files and with helpers that get put into App_Code
3) Yes. You can add references in web.config (compilation / assemblies). For more intellisense add an @using umbraco.MacroEngines; and cast Model to a DynamicNode
4) Because a macro is not a razor template :-) Razor templates are built in. Macros are blocks of functionality that you create yourself.
Thank you for your reply.
Is there an example for 1,2 and 3?
2 and 3 are just default functionality of Visual Studio really, so I'm sure that google is your friend.
Example for number 1 is simple:
Have a look at my blog posts on the subject as well.
for 2 and 3 respect to Umbraco... 1 is simple -:)
is working on a reply...