Tell us what you are trying to do? I have custom field as a URL which is a predefined fixed URL but has a few variables that need to be appended to it. These variables are data from other custom fields... Can I achieve this with Toolset? Also I would like to NOT show the URL as a raw URL but I'd like it to be a button that needs to be clicked to trigger the URL (so that the long URL is not displayed with all its variables)..
Is there any documentation that you are following?https://toolset.com/documentation/user-guides/views/passing-arguments-to-views/
Is there a similar example that we can see?
What is the link to your site?hidden link
You can use Types field shortcodes to generate any custom HTML markup you want. For example, let's say the fixed URL is stored in a custom field with the slug "my-url". The URL is https://google.com. You have URL parameters in 3 custom fields with slugs "param1", "param2", and "param3". The parameter values are 123, 234, and 345, respectively. You want to create a link that includes all 3 URL parameters with the fixed URL, but you want to display the fixed URL in the link text. You could do that with the following shortcode and HTML structure:
<a href='[types field="my-url" output="raw"][/types]?param1=[types field="param1" output="raw"][/types]¶m2=[types field="param2" output="raw"][/types]¶m3=[types field="param3" output="raw"][/types]'>[types field="my-url" output="raw"][/types]</a>
On the front-end, the link text looks like the fixed URL:
<em><u>hidden link</u></em>
But the link's href is actually:
<em><u>hidden link</u></em>
If you're trying to achieve something else, please provide an example of the HTML you want to generate and more details about the parameter values and names. I'll try to help.
Hi Christian
Thanks for the prompt response and update... really appreciate it..:-)..
I think I am clearer now on the possibilities and will try and experiment with it.. I am assuming I could easily create a button or image and put the URL as a link to the button/image.. am I right?
Let's say I have a URL which is visible only to a logged in user.. I've understood that I can pass custom URLs with parameters from other custom fields.. can I pass the email id of the logged in user? Could you please let me know how, if this is possible.?
Now I know passing the password too through the URL is not such a good idea but would it be possible too? If yes, could it be encrypted and then decrypted at the landing page?
OR would the fact that the user is logged in on a wordpress site be enough to log him in to another site in ReactJS just by having some workaround like a cookie? I have another application and I would want the user to be logged in directly when he moves from wordpress as a logged in user... alternatively if the react application does need a password input, can the react application use the wordpress database to verify the user? Of course I would be providing the React Application some credentials to access the wordpress database..
Please do advise if what I am trying to achieve above is possible and if you have an easier method to do this.
Regards,
Alim
I am assuming I could easily create a button or image and put the URL as a link to the button/image.. am I right?
You can create a link tag and wrap it around an image tag, like this:
<a href="<em><u>hidden link</u></em>"><img src="/path/to/button-image.jpg" /></a>
If that image looks like a button, then you have created a link to Google that looks like a button. Is that what you mean?
I've understood that I can pass custom URLs with parameters from other custom fields.. can I pass the email id of the logged in user?
You can use the Views shortcode wpv-current-user to access the current User's information like email address, login or User ID. I'm not sure what you mean by email ID, but I think you get the idea. Documentation for the current User shortcode is available here with example code: https://toolset.com/documentation/user-guides/views/views-shortcodes/#wpv-current-user
[wpv-current-user info="email"]
Now I know passing the password too through the URL is not such a good idea but would it be possible too? If yes, could it be encrypted and then decrypted at the landing page?
No, Toolset has no way to access a User's password from the database using shortcodes.
OR would the fact that the user is logged in on a wordpress site be enough to log him in to another site in ReactJS just by having some workaround like a cookie?
That's a good question but since authentication and authorizaton aren't in Toolset's suite of software, I'm not really the best source of information. Toolset doesn't integrate with any Single Sign On authorization apps or platforms. A token system like Oauth2 might be helpful. There are several Oauth plugins out there like these https://www.google.com/search?q=wordpress+oauth+plugins&oq=wordpress+oauth+plugins
My issue is resolved now. Thank you!
I am a bit clearer now.. but I think before I come back to you with questions I need to try and test a few things.. :-).. Thanks again Christian.. you've been of great help..:-)..
Regards,
Alim