Results 1 to 9 of 9

Thread: moderating owner edited data

  1. #1
    New user
    Join Date
    08-30-10.
    Posts
    23

    Default moderating owner edited data

    Hello, I am using Contao 2.11.9 and efg 1.16.2 Stable.

    I am building a website for an association of therapists, take a look here for a sample output:

    http://hypnosishealthpractitionerscanad ... ecials&for[name]=e&for[desig]=&for[locat]=&for[specials]=

    I'm using efg to allow each member to enter their own data. I was working on a way to let the logged in members edit their data as well using owner allowed front end editing. I want to have an editable version show up on their private profile page. This is a little difficult as I use paypal purchase registration to create the member with one set of private account data, then use the efg to create their publicly viewed data. I want to add a hidden into the efg form that contains a piece of unique member data but putting an insert tag into the hidden feilds default value isn't working.

    Anyways all that has now changed because the client wants to be able to moderate all the changes before they get published. So my question is this: how can I allow each paid member to edit their own data but only allow the changes to be made public after a moderator has reviewed them?

    Is efg even the best choice for this? I looked at using catalog and isotope to create products that were actually people but efg seemed to be a more elegant solution. I wish I could easily pluck values out of a database table and use them in the front and back ends. There's always so much more to learn!

  2. #2
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: moderating owner edited data

    I would normally expect this data to be in the tl_member table. If it is, can't you use the "Personal data" module that comes standard with Contao?

    I did see your posts about people being products and all, but I think you should sell memberships using Isotope and manage members using the members module?

  3. #3
    New user
    Join Date
    08-30-10.
    Posts
    23

    Default Re: moderating owner edited data

    Yes I use the Personal Data module, it's great. But each of my members has their personal account data, as well as their public data of business information. They maintain each one separately.

    Well Im getting closer. I put the username insert tag into a hidden form feild so I can select the right record when the member wants to edit their data. If I can just set the new data to published=0 by default, the the moderator can set that to 1 to make the changes visible. That's what I hope to do.

  4. #4
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: moderating owner edited data

    To do that last thing, can't you add a field called published, make it hidden and always set to 0?

    Is there one row of personal account data per member in the db? If so, why not move it all into the member table and add a second personal data module to edit that data. Alternatively alter that module and add version that uses the table you created? What is the reason you need an advanced form?

  5. #5
    New user
    Join Date
    08-30-10.
    Posts
    23

    Default Re: moderating owner edited data

    Excellent ideas, thank you so much for brainstorming for me and my project.

    I now have one bunch of account information that deals with personal info and is a paid subscription using paypal. And I have a second bunch of data which is the visible business information for each paid member. That group is set up using the efg and it has several searchable fields, owner editing, and a pretty output thanks to some css.

    My problem was how to put a form listing module on the protected account page that would show only that member's information. I solved it by creating a hidden field on the efg form called alias and I set it to {{user::username}}. So now each form has a unique hidden label.

    Then in a private form listing module that only appears on the protected my account page, I entered this as the condition: alias='{{user::username}}' and it worked like a charm. Now that the client can start testing the heat is off and my next job is to learn how use Contao hooks and the api. Any good english language tutorials out there?

    And how's that english language translation of the Contao book coming along? Thanks again for your help!

  6. #6
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: moderating owner edited data

    Good to see that you solved this. Perhaps you can add some more technical detail so other people who find this thread can use the same solution?

    I don't know a lot of good documentation, I use the online Contao maual as reference. Below is the page that covers all hooks. If I do not understand how to do something in Contao I download extensions that might do something similar. So when I want to use a hook and it doesn't work as expected I first look into the Contao code for the implementation of the hook. If that doesn't work I search for an extension that uses the hook and see if I can find out what I did wrong (and why I didn't understand the core code :P)

    https://contao.org/en/manual/3.0/custom ... ontao.html

    Also notice that the hooks are not the only ways to extend functionality. You can also use callbacks in the dca for many alterations. Callbacks mostly apply to the backend.

  7. #7
    New user
    Join Date
    08-30-10.
    Posts
    23

    Default Re: moderating owner edited data

    Well I don't know anything about php but lately I've been writing a lot of it. Here is a piece that helped me a lot. I put it at the end of the efg template list_fd_simple_default.xhtml:

    Code:
    <?php if ($intField == 0): ?>
      {{insert_module::47}}
    <?php endif; ?>
    $intField is a local variable and if it doesn't get incremented from zero then the form had no data to write out. In that case I present a blank form for the user to fill in for the first time.

    I have also added code to my efg template info_fd_table_default.xhtml that selects the avatar of the form's owner and displays it when the form is output to the front end. Working with the efg form and lister module was frustrating until I figured out that I had to save changes to my form as well as a save of the metadata of the top of the form. Both saves are necessary to get changes in the form structure to appear on the back end lister module.

    I added so much code to info_fd_table_default.xhtml that I called it by a different name that I then chose as the template in the back end module configuration. However, when a front end user who is not logged in views the form, the module uses the original template. When a member is logged in then they get the results of my modified template with the extra code. So when a member who owns a form looks at their own form they see their avatar, but when a guest looks at them they don't get the avatar.

    So I went back to the same name as the default for the template. But the public avatar is still not visible because the forms hidden field that contains the owners userid which is used to fetch the correct avatar, is not present in the guest output. So a logged in member who is the owner of a form, receives the hidden field and ses the avatar, but a guest doesn't get the hidden field and the avatar fetch fails. Why is the efg lister module presenting such different behavior to members and guests?

  8. #8
    New user
    Join Date
    08-30-10.
    Posts
    23

    Default Re: moderating owner edited data

    Am I going about this the hard way? All I need to do is associate an image, which happens to be an avatar, with a form. The public will see the image attached to the form, and the owner can change the image when they want. Is there an easy way to do this without adding logic to the efg templates?

  9. #9
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: moderating owner edited data

    Sorry, I have no idea what comes from where. Don't understand.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •