It already does, although some of the xslt extensions require a piece of XML to be put in them. Should not be a problem though as you can do a ToXml on most things that contain actual XML. You just call the extensions as you normally do in XSLT, just subsitute the colen for a dot. For example:
<a href="@umbraco.library.NiceUrl(Model.Id)">Link to this page</a>
Hi!
Model is the current node as a DynamicNode object. Basically you have all node properties accessible just as Model.BodyText, .Id, .Name and so on. There's also .Url and soon .IsProtected. You also access all macro params as Model.Parameters. And there's a bunch of 'navigation' methods that returns DynamicNode or DynamicNodeList. Model.Children, Model.Parent an so on. A great need of a wiki article for this ... :) Cheers, Jonas
@Sebastiaan: We still expect an RC very soon (maybe as soon as Monday) from where we recommend all new projects to use 4.7. There's currently no (0) razor related work items in the tracker (see here)
Have you encountered any major showstoppers since you expect it to take so long?
Definitely - hence the need for an RC. But it's rock solid stable from here (and the new additions are primarily navigation wrappers and very basic refactoring (= easy to test))
Not sure if this is right place for bug report, but I have tried umbraco 4.7 and installed in localhost/someapp/ - All images, starter kit links in backend right page are pointing just to localhost and not to localhost/someapp/ - I was interested to install blog4umbraco, but seems getting some errors. Would be good that all packages would be updated to support this version of umbraco, at least which are in online repository. - Would be nice to know more on forum plans, I have read that there are "probably" plans to publish umbraco forum itself? Is this true? Now seems nForum gets a lot attention, I understand flexibility of it and speed of implementation that brings umbraco, but I personaly would go with forum that has separate tables from umbraco and it would be uForum, but if there will be published umbraco forum in near future .... Just some calrity would be apreceated. -What you think, how will split usage between Razor and xslt? Will everything at some time be converted to razor rendering?
Most of this is not actually Razor related, but let me give you some (opinionated) answers:
- I don't recommend installing umbraco in a virtual directory. That being said, in theory, if you change everything to use ~/css and ~/scripts and so on, it should work. - This is one of the reasons why I wouldn't recommend using a vdir. Sorry, you'll have to update the references yourself. There is a new version of B4U coming that might handle this correctly. As packages are mainly built by enthousiasts, it's also common that once they are completed, the people making them are going to focus on other things. The fun of open source is that you could always open up the package and fix it yourself :-) - You heard right and I don't believe any release date has been communicated. So, it'll be here when it's done, I suppose. - For the time being, the macro's built in to starter kits and packages are all XSLT based. New packages may want to take advantage of Razor in the future. I expect that the majority of samples in Umbraco 5 (ETA: this summer), which is based on MVC3, will mainly use Razor.
How to start with Umbraco/Razor?
How to start with Umbraco/Razor?
What version you are looking for? Umbraco 4.6.1 or 4.7?
If you are using 4.6.1 : http://blog.pbdesk.com/2011/01/razor-support-in-umbraco.html
For 4.7 beta : http://www.cultiv.nl/blog/2011/2/16/how-to-use-razor-in-umbraco
But if you are looking forward to use more of razors in your umbraco site, I would suggest to wait till stable relase of 4.7.
Thanks & Regards,
Pinal Bhatt
I wish to use 4.7 and Razor because it's more friendly than xslt and so it will give a bost...
Cool... then i think you can have hands on with 4.7 beta. And in few days we can expect a stable release.
For 4.7 you can refer to following links to start with:
www.cultiv.nl/.../how-to-use-razor-in-umbraco
http://umbraco.com/follow-us/blog-archive/2011/2/23/umbraco-47-razor-feature-walkthrough-%E2%80%93-part-1
http://umbraco.com/follow-us/blog-archive/2011/2/24/umbraco-47-razor-feature-walkthrough-%E2%80%93-part-2
A few days is a bit optimistic Pinal, I expect it to take another 2 weeks to iron things out.
Will Razor in Umbraco support every Umbraco lib function of XSLT?
It already does, although some of the xslt extensions require a piece of XML to be put in them. Should not be a problem though as you can do a ToXml on most things that contain actual XML. You just call the extensions as you normally do in XSLT, just subsitute the colen for a dot. For example:
What Do Model mean in your example?
Model is basically Razors equivalent of '$currentPage' in XSLT. So:
is the same as doing:
Hi!
Model is the current node as a DynamicNode object. Basically you have all node properties accessible just as Model.BodyText, .Id, .Name and so on. There's also .Url and soon .IsProtected. You also access all macro params as Model.Parameters. And there's a bunch of 'navigation' methods that returns DynamicNode or DynamicNodeList. Model.Children, Model.Parent an so on. A great need of a wiki article for this ... :)
Cheers, Jonas
@Sebastiaan: We still expect an RC very soon (maybe as soon as Monday) from where we recommend all new projects to use 4.7. There's currently no (0) razor related work items in the tracker (see here)
Have you encountered any major showstoppers since you expect it to take so long?
No, not at all, I just expected that the new additions since the beta would need another round of testing before finalizing 4.7.
Definitely - hence the need for an RC. But it's rock solid stable from here (and the new additions are primarily navigation wrappers and very basic refactoring (= easy to test))
Agreed, it has been a very solid beta and I'm very happy with the non-Razor related bugfixes which were much needed. :-)
Not sure if this is right place for bug report, but I have tried umbraco 4.7 and installed in localhost/someapp/
- All images, starter kit links in backend right page are pointing just to localhost and not to localhost/someapp/
- I was interested to install blog4umbraco, but seems getting some errors. Would be good that all packages would be updated to support this version of umbraco, at least which are in online repository.
- Would be nice to know more on forum plans, I have read that there are "probably" plans to publish umbraco forum itself? Is this true? Now seems nForum gets a lot attention, I understand flexibility of it and speed of implementation that brings umbraco, but I personaly would go with forum that has separate tables from umbraco and it would be uForum, but if there will be published umbraco forum in near future .... Just some calrity would be apreceated.
-What you think, how will split usage between Razor and xslt? Will everything at some time be converted to razor rendering?
Thanks,
Saulius
Hey Saulius,
Most of this is not actually Razor related, but let me give you some (opinionated) answers:
- I don't recommend installing umbraco in a virtual directory. That being said, in theory, if you change everything to use ~/css and ~/scripts and so on, it should work.
- This is one of the reasons why I wouldn't recommend using a vdir. Sorry, you'll have to update the references yourself. There is a new version of B4U coming that might handle this correctly. As packages are mainly built by enthousiasts, it's also common that once they are completed, the people making them are going to focus on other things. The fun of open source is that you could always open up the package and fix it yourself :-)
- You heard right and I don't believe any release date has been communicated. So, it'll be here when it's done, I suppose.
- For the time being, the macro's built in to starter kits and packages are all XSLT based. New packages may want to take advantage of Razor in the future. I expect that the majority of samples in Umbraco 5 (ETA: this summer), which is based on MVC3, will mainly use Razor.
is working on a reply...