Copied to clipboard

Flag this post as spam?

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


  • Camron Tucker 11 posts 31 karma points
    Aug 29, 2011 @ 16:29
    Camron Tucker
    0

    How to create dynamic url by registered user?

    Our current site is being ported to Umbraco. This site is unique in that for each person who signs up with us gets their own unique url. For example, user Joe signs up and would get the url www.site.com/joe. Each person would have their own unique virtual folder right after site.com, but everything following that would be exactly the same for all users (site.com/joe/products, site.com/bob/products, site.com/mary/products, etc. ). The entire site structure would be exactly the same for all registered users, except for one bit of content that would be how to contact this person. The list of registered users is stored in a sql database and could be easily retrieved. There would be thousands of users and the list would constantly be changing. My question is in how to implement the custom url portion. I'm assuming I could do something with url rewriting but I'm not really sure how it would handle this.

    -Cam

  • Bo Damgaard Mortensen 719 posts 1207 karma points
    Aug 29, 2011 @ 19:43
    Bo Damgaard Mortensen
    0

    Hi Camron,

    I made something similar a while ago. My approach was as follows:

    When a member signs up he gets his own tree/site in Umbraco, so the structure would look something like this:

    - bomortensen (the nodename is the same as the username of the member, this will give you www.yoursite.com/bomortensen as URL)
              - Products
                         - Product 1
                         - Product 2
                         - Etc..

    To "relate" the actual member to the bomortensen node in the tree, simply place a MemberPicker datatype on the document which holds a "reference" to the member.

    Hope this sheds some light on the problem :-) And remember that this is just one way to do it!

    All the best,

    Bo 

  • Camron Tucker 11 posts 31 karma points
    Aug 29, 2011 @ 21:20
    Camron Tucker
    0

    Thanks for the reply Bo. So I understand this correctly, when you view the content tree you basically have a node for each member, and the page structure duplicated for each one? In my case I currently have 30k users that have their own (site.com/user). This seems manageble for a small group, but not a group that is as large as what I will need to implement. Am I correctly understanding your approach?

    -Cam

  • Bo Damgaard Mortensen 719 posts 1207 karma points
    Aug 29, 2011 @ 21:31
    Bo Damgaard Mortensen
    0

    Hi Camron,

    Yes you got it right :-)

    Umbraco *should* be able to handle 30k nodes as long as you structure it well enough. Having too many childnodes of a node will cause the tree to hang and ultimately time out.

    It should also be possible, although not that end-user friendly, to handle this with custom tables in your database and manipulate data from Dashboard usercontrols or even a custom section in Umbraco that reads/writes to the beforementioned custom tables.

    As far as I know, Umbraco is capable of handling 1 mill+ nodes (again, the structure is absolutely crucial)

    Also, if you have 30K Members in the members section you'll want to consider creating a custom control to search through the members as the members tree can get really slow with these amount of nodes :-)

    Hope this helps just a bit. Sites of that size requires a lot of thinking before doing ;-)

    - Bo

  • Camron Tucker 11 posts 31 karma points
    Aug 29, 2011 @ 21:54
    Camron Tucker
    0

    Wow, sounds like this might be pretty ugly to manage it with Members and Nodes. I have all the infrastructure in place to manage the users/members through sql and calls to a web service so I don't necessarily need to replicate that in umbraco. Is anyone aware of a way to allow for a node to be matched dynamically? i.e. the structure would be:   

           -site
              -users (location to be matched dynamically. This could be bob, john, mary, etc. but would be matched to my external list of users)
                 -products
                    -etc.
                    -etc.

     

  • Bo Damgaard Mortensen 719 posts 1207 karma points
    Aug 29, 2011 @ 22:02
    Bo Damgaard Mortensen
    0

    Hi again Camron,

    You're absolutely right that it would be quite a huge Umbraco installation with both 30K members and 30K corresponding nodes.

    If you want a more generic way of doing this and you already have the member/user infrastructure you could build the tree as you suggested:

    - Site
              - Users
                       - Products

    .. and have custom datatypes/usercontrols/dataeditors on these nodes to manipulate a given user and/or products. These controls will have to talk to your custom tables or external database then and make relations and CRUD operations as needed. I'd suggest you take a look at the videos about creating a custom datatype for Umbraco and data editors on umbraco.tv :-)

    Thanks again,

    Bo 

    Edit: and to answer your question: I think you will have to use rewriting rules when doing this as the "Users" node will have to actually be called "Users" to make sense to the end-user in Umbraco.

  • Camron Tucker 11 posts 31 karma points
    Aug 30, 2011 @ 00:55
    Camron Tucker
    0

    Thanks for all your help Bo. I think I will do exactly that, create a "user" node that will handle the actual user alias in combination with url rewriting.

    -Cam

  • Camron Tucker 11 posts 31 karma points
    Dec 16, 2011 @ 22:20
    Camron Tucker
    0

    Ok, an update to this topic. I'm starting to actually implement this process. I'm not using members at all. What I'm doing actually is I've added a 404handler that does the lookup to my database for the users site. For example, if the website is www.usersites.com/user I am taking the /user and looking that up to see if that is a registered user in my database. I've also modified NiceUrl to add the /user part to the beginning of the url. Everything works perfectly, EXCEPT the fact that if in my content I have an internal link, the link should point to /user/linked-page but instead is just /linked-page (the content writer doesn't know what user this page is loaded for so they can't hard-code specific links).

    Can anyone think of a good way to handle this situation? Or even a better way to go about this whole concept of dynamic urls?

    -Cam

Please Sign in or register to post replies

Write your reply to:

Draft