Copied to clipboard

Flag this post as spam?

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


  • Biagio Paruolo 1618 posts 1910 karma points c-trib
    Feb 25, 2011 @ 09:48
    Biagio Paruolo
    0

    How to start with Umbraco/Razor?

    How to start with Umbraco/Razor?

  • Pinal Bhatt 298 posts 390 karma points
    Feb 25, 2011 @ 10:11
    Pinal Bhatt
    0

    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

     

  • Biagio Paruolo 1618 posts 1910 karma points c-trib
    Feb 25, 2011 @ 15:30
    Biagio Paruolo
    0

    I wish to use 4.7 and Razor because it's more friendly than xslt and so it will give a bost...

  • Pinal Bhatt 298 posts 390 karma points
    Feb 25, 2011 @ 15:35
  • Sebastiaan Janssen 5058 posts 15520 karma points MVP admin hq
    Feb 25, 2011 @ 16:10
    Sebastiaan Janssen
    0

    A few days is a bit optimistic Pinal, I expect it to take another 2 weeks to iron things out.

  • Biagio Paruolo 1618 posts 1910 karma points c-trib
    Feb 25, 2011 @ 16:51
    Biagio Paruolo
    0

    Will Razor in Umbraco support every Umbraco lib function of XSLT?

  • Sebastiaan Janssen 5058 posts 15520 karma points MVP admin hq
    Feb 25, 2011 @ 16:56
    Sebastiaan Janssen
    0

    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>
  • Biagio Paruolo 1618 posts 1910 karma points c-trib
    Feb 26, 2011 @ 09:42
    Biagio Paruolo
    0

    What Do Model mean in your example?

  • Rick Mather 42 posts 124 karma points
    Feb 26, 2011 @ 18:36
    Rick Mather
    0

    Model is basically Razors equivalent of '$currentPage' in XSLT. So:

    <a href="@umbraco.library.NiceUrl(Model.Id)">

    is the same as doing:

    <a href="{umbraco.library:NiceUrl($currentPage/@id)}">
  • Jonas Eriksson 930 posts 1825 karma points
    Feb 26, 2011 @ 18:45
    Jonas Eriksson
    0

    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

  • Niels Hartvig 1951 posts 2391 karma points c-trib
    Feb 27, 2011 @ 12:22
    Niels Hartvig
    0

    @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?

  • Sebastiaan Janssen 5058 posts 15520 karma points MVP admin hq
    Feb 27, 2011 @ 12:24
    Sebastiaan Janssen
    0

    No, not at all, I just expected that the new additions since the beta would need another round of testing before finalizing 4.7.

  • Niels Hartvig 1951 posts 2391 karma points c-trib
    Feb 27, 2011 @ 12:25
    Niels Hartvig
    0

    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))

  • Sebastiaan Janssen 5058 posts 15520 karma points MVP admin hq
    Feb 27, 2011 @ 12:27
    Sebastiaan Janssen
    0

    Agreed, it has been a very solid beta and I'm very happy with the non-Razor related bugfixes which were much needed. :-)

  • Saulius 6 posts 25 karma points
    Feb 27, 2011 @ 22:43
    Saulius
    0

    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

  • Sebastiaan Janssen 5058 posts 15520 karma points MVP admin hq
    Feb 28, 2011 @ 08:07
    Sebastiaan Janssen
    0

    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. 

     

Please Sign in or register to post replies

Write your reply to:

Draft