Hi,
I'm using a form to send info requests.
The titles os each of these posts should display the post-title and the date of the day.
For the moment I have this line of code:
[cred_field field='post_title' value='[wpv-post-title] - [wpv-post-date]']
But I'd like to replace [wpv-post-date] by the date of the day where the info request is sent.
Which variable should I use ?
Thanks for your help.
Best regards,
Fabrice
Hello Fabrice and thank you for contacting Toolset support.
The following shortcodes are not guaranteed to return the information from the request:
[wpv-post-title] - [wpv-post-date]
If the form is placed inside a post's content template, it will return the information from that post. If the form is placed on a page, it will return the information from that page.
So, to better help you with this request, I prefer to take a closer look at your website and see where the form is used. That way, I will give accurate advice. If you agree, your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **
Please let me know where the form is used, or share a URL where I can see the form in the frontend.
Thank you, I confirm that the credentials are working.
However, I'll also need to know where the form is used. Because that will affect the output of the shortcodes?
Is it used inside a content template? What content template?
Is it used inside a page/post? What is it?
Can you share a URL where we can see the form in the frontend?
I understand.
For the moment it is used only on every project pages like this one:
hidden link
Because the form is shown inside projects' single post pages, the shortcodes will return data from the project. You will get the project's title, and the project's created date. If you need the current date, you will have to create a shortcode for it. Check an example here https://toolset.com/forums/topic/display-current-date-in-view-or-cred-form/#post-477276
However, instead of generating the title using a shortcode, I would suggest using custom code to hook into the form submission process and update the title programmatically. Check an example here https://toolset.com/forums/topic/auto-populate-parent-title-and-date-as-child-content-title/#post-1285213
The next reply on that forum thread is also interesting, please take the time to read it.
Read more about the cred_save_data action here https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
If you are still unsure what solution to implement, let me know and I'll help with the custom code.
My issue is resolved now. Thank you!