We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27194
    • 9 Posts
    Hello folks,

    what’s the best way to use MODx to create a page which displays data applicable to the currently logged-in user? I’m thinking the best way might be to create a page accessible to logged-in webusers, and then getting it to read a GET var from the URL. What I’m going to have trouble with:


    • Getting a GET var into a snippet on a page
    • Finding a nice way for the Manager to edit the contents of that page for a selected webuser.

    What do you think? I’d be glad of any pointers.
    Cheers,
    J.
      • 13312
      • 13 Posts
      I don’t quite get what are you trying to get smiley ...but have you tried creating document groups and adding web groups into it. Then create pages and assign them to the document groups. Also if you are using the login snippet, you should update its &loginhomeid=`2,3,4` where 2,3,4 are starting document id’s for different document groups.
      You don’t have to write even a single line of code.

      I hope that helps
        • 27376
        • 576 Posts
        Perhaps you’re looking for the Extended User Profiling snippet?
          • 27194
          • 9 Posts
          Quote from: sirlancelot at Feb 20, 2007, 12:37 PM

          Perhaps you’re looking for the Extended User Profiling snippet?

          Well, having had a play with it, not quite. I’m not particularly fussed about users being able to edit their own pages, but PPP does cover the issue of having a page displayed with information pertinant to the currently logged-in user. I suppose what I want is basically TVs that change depending on a GET var. Maybe someone knows the format for a @SELECT in a TV which could pick the current user’s data out of the database? Then I just have to solve the admin editing problem. In terms of editing this data, is there a nice database frontend module available for MODx?

          Cheers,
          J.
            • 13312
            • 13 Posts
            what kind of user data would you like to get from the database?
              • 27194
              • 9 Posts
              Quote from: jaanus at Feb 22, 2007, 09:48 AM

              what kind of user data would you like to get from the database?

              Just a single variable which will indicate progress of the customer’s case (I’m working for a firm of solicitors). I would then reference that from a snippet which would draw a flowchart to show the progress. I suppose I can code all of this, but I wondered if MODx had a feature to allow a single page to be updated with different data depending on the logged in user. That way I can use the Manager to best effect with the minimum of coding.

              Cheers for your help. I’m beginning to understand the problem more fully.

              J.
                • 13312
                • 13 Posts
                You can get the id of the logged-in user by calling $modx->getLoginUserID(); in your snippet.

                Suppose you have a table PROGRESS with fields: id (primary key), order (your variable) and user (id of the user
                ) Now you make a query which would retrieve you the order from the table PROGRESS with user being the id you just got via $modx->getLoginUserID();

                Now you have the order variable and can do the drawing.

                Oh and don’t forget to make an UI for inserting the data into the PROGRESS table smiley