Copied to clipboard

Flag this post as spam?

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


  • Jeric 122 posts 192 karma points
    Mar 31, 2015 @ 19:12
    Jeric
    0

    How to get Current Page Url inside grid

    Was wondering if there's a way to get current page url when you are inside your grid.
    Like in the example below if you are inside the "gridView", how do you get the Current Page URL?

    Eg if you are rendering your grid as follow with the property of your grid called "content" and your grid view called "gridView"
    @Model.Content.GetGridHtml("content", "gridView")

    Thanks

     

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Mar 31, 2015 @ 20:17
    Dennis Aaen
    3

    Hi Jeric,

    You can get the current page url with this code,

    @Model.Content.Url 

    But if you mean that that you want an url inside that grid, then I don´t think that is possible, because you can´t get specific part of the data in the grid on the page. Regard the grid layout best practices documentation https://our.umbraco.org/Documentation/Using-Umbraco/Backoffice-Overview/Property-Editors/Built-in-Property-Editors-v7/Grid-Layout-Best-Practices and see the limitation section. https://our.umbraco.org/Documentation/Using-Umbraco/Backoffice-Overview/Property-Editors/Built-in-Property-Editors-v7/Grid-Layout-Best-Practices#Limitations

    /Dennis

  • Kitty 8 posts 98 karma points
    Sep 28, 2017 @ 09:08
    Kitty
    0

    Thanks Dennis, on a slightly different issue I've searched everywhere to find how to get the current page Url, so you've solved my problem :)

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Sep 28, 2017 @ 09:36
    Dennis Aaen
    0

    Hi Kitty,

    I am glad that I could help you solve your problem.

    Have a nice day :)

    /Dennis

  • Jeric 122 posts 192 karma points
    Apr 01, 2015 @ 11:00
    Jeric
    0

    Thanks Dennis, thought so that we can't get specific part of data in the grid

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Apr 01, 2015 @ 11:12
    Dennis Aaen
    0

    Hi Jeric,

    No it´s not possible at the moment to get specific part of data in the grid. When you call the @Model.Content("content","gridView") you will get the full JSON data for the page.

    /Dennis

  • 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