PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Data from currently displayed page (Photo Gallery)

  1. tdiaz1
    Member

    I'm using Nextgen Gallery on a project where I'm placing 10 years of photos up and want to have a form available from the page that when selected opens in a new window and is pre-populated with the referring URL and photo name at least. The photo name is available via variable (echo $image->filename) as are other variables (title, description, etc.)

    I want to have that so corrections can be submitted and the filename/description text can be captured so that they don't have to figure that out themselves (and we get correct information), and the user can edit the existing text and submit it.

    Would I be able to populate form data with php variables as such, ( $iptc['location'], $image->filename, etc.)?

    Since the form would be short coded from the portion of the page that is generated when the variables are active.. at least that part of the problem would be solved, I'd think. :)

    Posted 12 years ago on Tuesday December 27, 2011 | Permalink
  2. You can populate any of your form fields with any variables that are available in the php $_POST. So, yes, you can do this. You would use the gform_pre_render filter to do it.

    If the form is embedded in the page, you will handle it differently than if you send them to the form FROM the page. Do you have an example in use where we can see how this works now?

    Posted 12 years ago on Tuesday December 27, 2011 | Permalink
  3. tdiaz1
    Member

    Sorry for the post 'n run- I had some other issues with the project that this is for, and have passed that now, so I can move on.

    The intent is for corrections to be submitted on images, for example:

    http://sq47.org/photo-gallery/2013-activities

    If someone knows who that is, or wants to submit any other information about the photo being viewed, I want to have a GF that is pre-populated with the image filename, caption/title/description that is there now. The entries would either be displayed as a read only fields, or perhaps editable, I have not decided. If one is read only, I'll just have a blank below it. Some fields, like the event name will be static so that it's referenced the same on the local image library, where updates can be made and then the site updated.

    The things I'd like to integrate into the form that would be linked to from that gallery page would be: (What / it's variable) IE: <?php echo $meta['filename'] ?>

    page url (Get the Permalink to the referred page?)
    file name: $meta['filename']
    description $iptc['description']
    headline $iptc['headline']

    I tried putting the <?php echo $variable ..statement into the field for filling dynamically, I didn't expect it to work but ...

    The Gallery page is a template, with the form embedded in it:
    http://pastebin.com/kPBdHS8U - I may turn that into a link so that the fields are not visible unless the user logs in, or specifically clicks the link to view that image with the form present, as I don't really want it to have it all there on every link. For now, this is a 'hidden' page, for sandboxing.

    Posted 12 years ago on Monday January 23, 2012 | Permalink
  4. Hello!

    tdiaz1 - thanks for pasiting your PasteBin, it looks like I am trying to accomplish the same thing as yourself. I checked your link but it is not available. How are you setting up your form?

    Thanks.

    -DK

    Posted 11 years ago on Friday January 11, 2013 | Permalink
  5. DK, if tdiaz1 does not show up, please feel free to ask your question here and state what you would like to do and let us know the URL of the page on your site where your form and gallery are. Thank you.

    Posted 11 years ago on Saturday January 12, 2013 | Permalink