Support » Plugin: User Submitted Posts » Passing a variable to the USP

  • Resolved shoqvalue

    (@shoqvalue)


    Hi Jeff

    We love this plugin. It does exactly what we’d been hoping for, but for one small detail.

    I am not much of a programmer (but I play one on Twitter). I am also new to WordPress. What we want to do is:

    1) insert a variable into the USP form’s hidden field; specifically, the originating page’s ID (or name, but ID shorter) where the form was spawned via the [shortcode].

    2) On submit, that variable would be prepended to the “Post Name” field so our form recipients have a precise page ID reference for the submission.

    I assume this is fairly simple, but it’s above my pay grade. I can edit php templates like a demon, tho 🙂 (we’re a nonprofit, but can find a coder to implement it, probalby). If you can tell us basically how to achieve this, I’d be eternally grateful.

    Matt

    PS It’s entirely possible this obvious need is already achievable with your current tool. Please note: we can’t use categories, even if we solved the output to post name issue, because we’ll have one form for every post on the site. And that’s a fairly high number. You might consider our prepending idea as a standard feature, btw. We can’t be the only people who want to ID the submission.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hmm, longer story short, all we need is a way to pre-pend to the form’s “Post Name” field when it first opens with the post’s ID, or better, a custom “string” we add to the shortcode. That’s it. So long as user knows not to change that post name ID, we’re good. (And these are staff users, not end users, so no big deal)

    Plugin Author Jeff Starr

    (@specialk)

    Hi Matt,

    Glad to help.

    So if I understand correctly, you need to prepend the post ID to the post title?

    Well, after we fooled with plugin more, we don’t even need to prepend it, really. All we need to do is this:

    Your Name
    [ <insert user name here ]

    Post Title
    [ Insert current post title (containing shortcode) here ]

    That’s basically it.

    Although additionally, it would also be great if we could populate the hidden category field with the category term of just one branch of our categories taxonomy. eg. categories/projects/project_name/[get current page’s term in only this branch]

    We cannot possibly send our hundreds of project categories across the wire on every page load, nor would users want to navigate them (which is also an issue in your configurator, which has an interface that doesn’t anticipate a very large taxonomy)

    Thanks for your help! BTW, our non-profit project URL is FactsforAmerica.com

    Plugin Author Jeff Starr

    (@specialk)

    Glad to help. So when you say this:

    Your Name
    [ <insert user name here ]

    Post Title
    [ Insert current post title (containing shortcode) here ]

    ..are you referring to the form itself, the content in the backend, or the content as displayed on the front-end?

    I am referring to the form itself. We simply want to capture the user launching the form, and the title of the page they launched it from. That’s it.

    Plugin Author Jeff Starr

    (@specialk)

    Okay so you only want to display those two fields (Name and Title) on the form, correct? If so, you can visit the plugin settings and set all of the other fields to not display. Does that work for you?

    Oh, what a fail. Someone had closed our author admin column and I didn’t realize it when reviewing the plugin. Obviously, we already have the user ID 🙂 It’s just the title we need inserted into the submission form’s title field by default (probably not a bad idea as a standard option in the configurator)

    Plugin Author Jeff Starr

    (@specialk)

    “It’s just the title we need inserted into the submission form’s title field by default”

    ..so here are a couple of ways to go about this:

    1) Create a custom form as explained in the documentation. That would enable you to add whatever custom code is required.

    2) Use a JavaScript snippet to grab the title and insert into the form field

    There are other ways to accomplish, but either of those should help get you there.

    Plugin Author Jeff Starr

    (@specialk)

    Hi shoqvalue, I hope you got this sorted out. I’m gonna go ahead and mark this topic as resolved to help keep things organized. Feel free to follow-up or post afresh with any new issues or questions, I’m glad to help however possible. Thank you.

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.