Copied to clipboard

Flag this post as spam?

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


  • Beau D'Amore 29 posts 70 karma points
    Jun 16, 2014 @ 04:42
    Beau D'Amore
    0

    Custom Controller URL(s) for 'Members Area'

    I have created a (will be a set of) Controller/Partial View via Visual Studio 2012 for bringing up GPS Data for a user. I now need to:

    a. tie it into an existing Umbraco template

    b. modify the URL from

    mydomain.com/umbraco/Surface/TrackHistory/Tracks/1077 (1077 being the UmbracoMemberID)

    to

    - mydomain.com/TrackHistory/Tracks/1077 (so this will be easily shared among social websites as well)

    Thanks for reading :) and helping if possible

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Jun 16, 2014 @ 11:56
    Dave Woestenborghs
    0

    Hi,

    Maybe this blogpost by Warren can help you to do this :

    http://creativewebspecialist.co.uk/2013/12/03/using-umbraco-pipeline-for-member-profile-urls/

     

    Dave

  • Andy Butland 422 posts 2334 karma points MVP 4x hq c-trib
    Jun 16, 2014 @ 18:08
    Andy Butland
    0

    Look into URL rewrite for the second requirement?  Should be fairly easy to create a rule to strip out the /umbraco/Surface/ if you don't want that.  However... as you say, you are returning a partial view.  Will that make sense if a direct URL to it is shared and used?

    Andy

  • Beau D'Amore 29 posts 70 karma points
    Jun 16, 2014 @ 18:23
    Beau D'Amore
    0

    Dave, can't make heads or tails of that blog :(

    Andy, ok, I made a rule like this:

     <add name="MembersArea"

           virtualUrl="^~/TrackHistory(.*)"

           rewriteUrlParameter="ExcludeFromClientQueryString"

           destinationUrl="~/umbraco/surface/TrackHistory/$1"

     

           ignoreCase="true" />

    But I can still nav to:
    http://localhost:1832/umbraco/Surface/TrackHistory/Tracks/1107 but it doesn't redirect to just http://localhost:1832//TrackHistory/Tracks/1107
    Although I CAN go to http://localhost:1832//TrackHistory/Details/1 fine...
    Q. How do I make my @Html.ActionLinks point that way?
    If I do @Html.ActionLink("See Your Tracks!", "Tracks", "TrackHistory" ,new { id = memberID },null)      
    it goes to http://localhost:1832/umbraco/Surface/TrackHistory/Tracks/1107
    and YES, you are correct, I made a boo-boo in making it a partial view... However, either way, partial or view, it's not picking up the _layout, its just unstyled...
    Background: the way I did this was via VS2012 adding a controller/view not via Umbraco back office... perhaps that's the disconnect... Also, using a LINQ to SQL Classes.dbml file for my model manipulation. Is there a more Umbraco integrated way of doing this? I don't feel I'm integrated with U7, but more or less running next to it trying to throw lines across to hook up my GPS tables and logic... I'd like this to be more integrated... ugh
    I am customizing U7 for this whole Runner's GPS mobile app. I have a few tables that handle the GPS lat/lng track info, but they're not quite incorporated into U7 fully.. I didn't add anythiong via document types, templates, etc.. that whole business is confusing. (and I watched all the umbraco.tv videos..)
    Guess I'm going to keep banging on this... it's diff from mvc 4 practices to work with... haven't quite 'clicked' yet.
    Am I supposed to add doc types for Track and TrackLocations (my GPS tables) and somwhow manipulate them that way?
    My Custom controllers handle the POsts from the iOS apps and just add rows to tables.. should I somehow be interfacing U7 and adding documents of doctype Track and TrackLocations?
Please Sign in or register to post replies

Write your reply to:

Draft