We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9496
    • 113 Posts
    Is it possible to have additional fields on the photo upload form. Id like to have added to the upload template versus only being able to access it via the MG Gallery Admin after the photo has been uploaded. After searching about I noticed that v 6 has a "custom fields" but I can’t find any documentation on where to get it (the sticky linky doesnt work).

    I would think I could modify the upload template somehow, basically adding the title element to the the form. As well as automatically attaching the username via a hidden field, populated with the user name { or the full name field}. Or just by adding a new name custom field and have it sent along with the upload form may be easier (but redundant)

    So basically when get to the managment page it would show something like
    Title:______________________________
    File<input>_________________ [ Browse ]
    [ submit ]
    

    *a hidden field with the users full name db entry.

    Also is there documentation on how to modify the output templates to show this? So on my gallery outer template it would look something like:


    -
    -----------
    |   gal      |
    | thumb  |
    |             |
    _______
    
    [title]
    submitted by: [username]


    Feel free to point me to the right sport if this as already been answered and thanks for all of the help.
    P
      • 7923
      • 4,213 Posts
      The v0.6 test version is attached to the first post of the sticky thread.

      You can use &customFields parameter to define additional fields for pictures. Just define new fields (comma delimited) by using the parameter and then create custom managePictureTpl and duplicate the default title field in the template for example with the name of your custom field.

      But you cannot send the picture field data at the same time when you are uploading the image. It has to be uploaded first and then save the data for it.


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 9496
        • 113 Posts
        Hey Doze-
        Thanks for the heads up. It will require some thinking on how to logically structure it it on my part, but no worries.

        On the .6 note, I still cannot get the link in the sticky to work. I’m probably doing something wrong, but I know you were going through some hassle on the SVN thing. Do you think you can email me the .zip file when you get a chance? Or point me to some other way of getting to it?

        Again, thanks for all of the hard work.
        -P
          • 7923
          • 4,213 Posts
          Yes, the striked out link at the top of the post is not working, but scroll to the bottom of the first post, the file is there as an attachment.


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."
            • 9496
            • 113 Posts
            Sweet, thanks. I guess I need to eat more carrots, he he.
            -P
              • 9496
              • 113 Posts
              FYI, I implemented the new code and it works like a charm.
              Thx-
              P

              For those who are interested I simply modified the manager/picture templates using phx so that if the user hasnt uploaded images yet, all they will see is step 1: upload. Then when the upload(s) are complete the second step appears which shows the uploaded image as well as the title field for them to fill in. And then I set up a step three, which includes the save button. IF they have already posted then all 3 steps show up at once.

              I also added a hidden submitted_by field in the form which collects the logged in use name so I can display it later in the gallery template (its redundant as mg already collects the userid but I’m kinda lazy and didnt want to do a custom userid to username translation snippet when I want to display it in the gallery.)

              I also made sure that in the maxigallery call &customFields=`submitted_by` was set with the new custom fields(in this case submitted_by).

              It works quite well as a step by step, all one page and (I think anyway) fairly straightforward.