Skip Navigation

[Resolved] Pass field values to build URL query string and store value in new field

This support ticket is created 3 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 6 replies, has 2 voices.

Last updated by cynthiaC 3 years, 2 months ago.

Assisted by: Jamal.

Author
Posts
#2209545

Tell us what you are trying to do?
I want to build an application for users to enter data into a Toolset form which will later be used to populate various forms on other sites. In a view, I would create buttons with labels such as "Search Site A" and "Search Site B."
Site A and Site B would each require different data and different field names. For example, one site may require a value for "flavor" while the other calls the same field "flavor_type." Also, I might want to pass the value for "flavor" to Site A, but pass the value for "color" to Site B.
So, I need to build completely separate URLs for each button and store them for whenever the user needs to use them.

Is there any documentation that you are following?
https://toolset.com/documentation/programmer-reference/cred-api/#cred_success_redirect
https://toolset.com/forums/topic/pass-parameter-of-cred-fields-to-another-form-via-url/

Is there a similar example that we can see?
Not that I know of.

What is the link to your site?
It doesn't exist yet.

#2210061

Hello and thank you for contacting Toolset support.

I am sorry, but I am not really sure to understand the question. Are you looking to build custom URLs where you pass values to the other websites, or are you looking to store these values on the database(in custom fields), then use them to generate buttons/links?

Maybe you do not need to save the URLs on the database at all, but you will have to generate the URLs inside classic HTML blocks, or Fields&Text blocks like this:

<a href="<em><u>hidden link</u></em> field="flavor"][/types]">Seach site A</a>
<a href="<em><u>hidden link</u></em> field="color"][/types]">Seach site B</a>

Can you provide more details? Maybe some examples with the expected URLs?

#2210117

Thanks for your reply, Jamal. My apologies for being unclear. Suppose a registered user of my site wants to find information about the Githens family in Platte County, Missouri. They would fill out a form on my site that will save their information to the database. At the same time, the site will generate a "Research Plan" based on their form entries. For example, suppose they filled out two text fields (not selectable), one for Family Name (surname) and one for Place. The search results will display "Research Plan" containing a list (from my database) of websites or their online databases that are likely to include the desired information. Next to each listing on the "Research Plan" would be one or more button links to each of those websites with the user's search prefilled. When the user clicks the button, the search form is prepopulated and the search is completed, ready for the user to add filters and review. When the user returns to their "Research Plan," they will log their search results and continue to the next search.

Here's an example of two expected URLs from separate searches of the FamilySearch website. Each search would require a separate link because the site does not allow for Boolean searches:
--hidden link
--hidden link

Here's an example of a search for the same values on WorldCat which allows Boolean. In this case, I would only need to display one button:
--hidden link

Chances are that my site visitor won't be able to complete their searches of all the databases during a single session, so I will need a way to store the "Research Plan" as a post they can return to.

Hope this clarifies!

#2210711

Thank you for the clarification, I understand the use case better now.

However, I still do not see any use in storing the search URLs. Because the search would be calculated/generated from the stored information(Place/Family), we can generate the search links instead of storing them on the database.

The sample URLs use the + sign to replace spaces. For example "Platte+County%22+Missouri" instead of "Platte County, Missouri". So, I suggest producing a custom shortcode to generate the URLs. That way you can use it like:

[my-search-shortcode-1 site="<em><u>hidden link</u></em>" query="surname:Githens"]
or
[my-search-shortcode-1 site="<em><u>hidden link</u></em>" query="surname:[types field="surname"][/types]"]

Does it make sense? Let me know if you have any further quesitons.

#2214307

Thank you. I am trying to understand. Would you please point me toward the documentation on generating shortcodes using Toolset? Thank you.

#2214973

These are the Toolset shortcodes that may be generated through the User Interface:
- https://toolset.com/documentation/customizing-sites-using-php/functions/
- https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-taxonomy-field

But when I talked about a custom shortcode such as "my-search-shortcode-1", that is not generated with Toolset. It has to be built using custom code. Check this article:
- https://toolset.com/documentation/programmer-reference/adding-custom-code/how-to-create-a-custom-shortcode/

#2215923

I appreciate the references, Jamal. I will study them and open another ticket if I need more help. Thank you!