Copied to clipboard

Flag this post as spam?

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


  • Moran 277 posts 885 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 1303 posts 2895 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 277 posts 885 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 1303 posts 2895 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

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies