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

    I'm a newbie in MODX and all my previous expirience was with Drupal smiley Now I tries to understand how to make some (I hope) basic things in MODX Revolution too.

    So what I need to do:

    User registration (I guess, Registration snipplet?)
    On specific page says "You need to register" for guests and show form for logged in users. (how?)
    Form should have some fields:

    Title
    Description
    Few more additional descriptions
    Selectbox with Category (how to manage categories in MODX?)
    Input for Tags (tagLister?). Where tags are separated by commas, have auto suggestion (how?)
    AJAX upload images, with instant preview (how?)

    After posting form this content should be associated with user and user can edit this content in the future.

    Thank you in advance.
      • 5430
      • 247 Posts
      I'd start here: http://rtfm.modx.com/display/ADDON/Login

      The login snippet can be installed via package management and the documentation on the page above gives you a lot of the details you're looking for along with some examples/tutorials. I think you'll find what you need there.
        • 42668
        • 6 Posts
        claytonk, thank you. Your link looks like an answer my first two questions smiley What's about form, do you have any suggesstions?
          • 5430
          • 247 Posts
          Here's the basic form example from the documentation: http://rtfm.modx.com/display/ADDON/Register.Example+Form+1

          In this example the form and the snippet call are placed in the same resource (I'd recommend shutting off rich text on this resource if you haven't already).

          Take a look through the user profile interface in the manager to get a feel for what fields are already present in the database table for user info, if you can, make use of what's there, if not, you can create/use custom fields. Also from the documentation: http://rtfm.modx.com/display/ADDON/Login.Using+Custom+Fields

          Everything you need is there (though you may need to dig around the documentation a bit, be sure to look over the pages thoroughly to find links to related documentation_, but I know MODx is new to you so if you're not seeing/getting it post back, we'll do what we can to help.
            • 5430
            • 247 Posts
            Sorry, just for clarity in case this wasn't obvious from the documentation, the form in the example is just a starting point. You can create any custom form you want as long as tags you're using are correctly tied to database fields or custom fields you're creating (i.e. [[!+reg.username]] will save the username entered in this field, you can change "username" to match any existing field in the database to save that value).
              • 42668
              • 6 Posts
              claytonk, I, probably, a bit confuse you. Fields, which I describe above, are not custom fields for user profile. It's form for document with custom fields (category, tags, galleries). I've tried to dig google for some examples sush form, but no luck sad
                • 42668
                • 6 Posts
                Quote from: claytonk at Jan 30, 2013, 12:37 PM
                Sorry, just for clarity in case this wasn't obvious from the documentation, the form in the example is just a starting point. You can create any custom form you want as long as tags you're using are correctly tied to database fields or custom fields you're creating (i.e. [[!+reg.username]] will save the username entered in this field, you can change "username" to match any existing field in the database to save that value).

                I see now smiley but do you know more complicated tutorial?
                  • 5430
                  • 247 Posts
                  Quote from: alexei at Jan 30, 2013, 12:17 PM
                  After posting form this content should be associated with user and user can edit this content in the future.

                  Yes, very much confused. If you want this info tied only to this user why wouldn't you want it recorded in the user profile? You can display user profile info on any page of your site based on the logged in user (by using placeholders in your resource or your template). Maybe you could describe a little more thoroughly what your objective is overall. There are always dozens of ways to accomplish the same thing, but we need to know what the destination is.

                  Are you wanting these users to be able to create and edit resources (pages) on your site without logging into the manager? That can be done using something like http://modx.com/extras/package/newspublisher, there are other options as well. Give us some more details if you can.
                    • 42668
                    • 6 Posts
                    Well, if in few words, then task is to have ability for logged users to post some text (with assigned tags and category) and attached images (gallery). And then we should find this posts by author. I hope it's clear now smiley Sorry for possible mistakes, but English is my second language.
                      • 5430
                      • 247 Posts
                      You want them to be able to post content but you don't want them to have manager access?

                      If so, something like newspublisher (link previously posted) would do the trick for integrating the field in the front end with the MODx database. You can read a tutorial here: http://bobsguides.com/newspublisher-tutorial.html. I think there are some other options here, but to be honest, front-end editing isn't really a MODx specialty in my opinion, it's one of the features that really needs developing. There are some promising plugins in the works though.

                      For displaying/filtering pages by author/category etc. you can do this in many ways, but the most common are probably to use something like getResources http://rtfm.modx.com/display/ADDON/getResources and/or Articles http://rtfm.modx.com/display/ADDON/Articles

                      None of this may be as simple as you'd hoped. What you're describing isn't exactly "simple", but certainly doable.