Copied to clipboard

Flag this post as spam?

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


  • Moran 285 posts 934 karma points
    Feb 07, 2014 @ 21:02
    Moran
    0

    Getting the store id

    Hi

    In web forms I get the store id using:

    var _storeId = <umbraco:Item field="store" recursive="true" runat="server" />;

    How do I get the id in  MVC ? I tried:

    var _storeId = @Umbraco.Field("store", recursive: true);

    but I get nothing, I have the store picker property in my master doc type.

    I am using umbraco 6.1.6 MVC and Tea 2.2.2

  • Rune Grønkjær 1372 posts 3103 karma points
    Feb 10, 2014 @ 07:51
    Rune Grønkjær
    100

    Hi Moran,

    Good question. What you are doing there should work. It's just a property value like any other. Maybe you should try to get the node on which you know the property is, and then get the property.

    /Rune

  • Moran 285 posts 934 karma points
    Feb 11, 2014 @ 07:29
    Moran
    0

    Thanks

    My bad I had the store property in the "product catalog" doc type.

  • Rune Grønkjær 1372 posts 3103 karma points
    Feb 11, 2014 @ 11:50
    Rune Grønkjær
    0

    Ah, that could give you problems when navigating to other parts of the website. Good thing you found the solution.

    /Rune

Please Sign in or register to post replies

Write your reply to:

Draft