Tell us what you are trying to do?
Hi;
Firstly, I couldn't understand why we have to create two forms when we need repeatable fields. Maybe, I missed something.
(One for normal post one for repetable fields). Can stable version of type 3 new features handle this ?
I want to use all post fields (also repetable fields) in a single form . Also this one is important for to edit posts.
There's a warning as " Form type and post type do not match" when I want to edit repatable fields .
Thanks
It's not possible to edit the post's custom fields and the post's repeating field groups in the same form yet. The CRED beta is still a work-in-progress, and, I agree, the process is not very intuitive right now. We're working on a way to streamline this process and support nested repeating field groups in CRED, and the best place to follow along with our M2M progress is our blog: https://toolset.com/blog
I look forward to see updates since type 3 announced.
Also , please consider that all parent posts are avaiable to select on repatable cred forms.. I can't limit the posts to select according to author of post. user should see only his own post.
Thanks
As far as selecting the parent post, if you do not want to give your site users the ability to select a parent, you can use the "value" shortcode attribute to preset the parent post ID. You can then hide this input field from the front-end using a hidden div or some other CSS. Here's an example, where the CRED form is placed on the parent single post:
<div style="display:none;">
[cred_field field='@book-chapter.parent' value='[wpv-post-id id="$current_page"]' select_text='--- not set ---' class='form-control' output='bootstrap']
</div>
Sorry Christian, something misunderstood. You I know I can't use all fields in the same form. So I decided to use cred forms like multi step form.(Post cred forms goes to repeateble cred form page after published )I use cred form (repeatable fields) with shortcode on a page . So post id option doesn't work.
Default is; every user's post shown to everyone. I just need to show user own posts(@parent) to user.
Thanks
I understand, but this is the only option I know of that does not require significant custom code. The original form must redirect to the new post, and the repeating field group form must be included on the new post page. Otherwise, you can use custom code to modify the redirection URL, include a URL parameter that refers to the parent post's ID like yoursite.com/create-repeating-fields-redirect-page/?parentid=12345. Then read that URL parameter value and insert it in the parent post CRED field.
Here is the redirect manipulation API:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_success_redirect
Here is a custom shortcode that lets you access URL parameters:
add_shortcode( 'wpv-post-param', 'wpv_post_param_shortcode' );
function wpv_post_param_shortcode( $atts ) {
if ( !empty( $atts['var'] ) ) {
$var = (array)$_GET[$atts['var']];
return esc_html( implode( ', ', $var ) );
}
}
Use it like this:
<div style="display:none;">
[cred_field field='@book-chapter.parent' value='[wpv-post-param var="parentid"]' select_text='--- not set ---' class='form-control' output='bootstrap']
</div>
Hi Christian,
Every user reach every users post at select gadget area without your codes.
I've followed your directions.
Code added to function.php, shortcode added to toolset setting. Custom toolset code aaded to repeatable cred form.
"display:none" hide field area.
You may see here: hidden link
Unfortunately, no result.
Thanks...
I'm unable to access that shortened URL, sorry. I see the following error:
https://goo.gl/2z62UK – this goo.gl shortlink has been disabled. It was found to be violating our Terms of Service. Click here and here for more information about our terms and policies respectively.
It's the same as screenshot. I can give you an admin pass to see. Google short link was for making link hidden.( Project Web Site)
Any link text you share publicly in the forum is hidden so only you and Toolset supporters can see it. I need the full URL including the parent post ID parameter I mentioned before:
like yoursite.com/create-repeating-fields-redirect-page/?parentid=12345
Here's the link
hidden link
Thanks
Please provide login credentials in the private reply fields here.
I see two things:
1. The URL parameter is parentid=243, but there is no Gadget with ID 243. ID 243 is the page "Repetable Zone". This isn't quite right, because the parentid must be the Gadget ID, not the ID of the current Page. You must modify the URL parameter to match the parent Gadget ID.
2. The wpv-post-param var value should not be a hard-coded number like 243, it should be "parentid", like this:
[cred_field field='@repeatable-zone.parent' value='[wpv-post-param var="parentid"]' select_text='--- not set ---' class='form-control' output='bootstrap']
This will let you pass the Gadget ID into the URL parameter.
I'm really confused. Codes are revised as you mentioned. But nothing changed.
I think I couldn't explain what I need.My mistake.
I don't want to hide gadget parent select option.It hides dropdown field even /?parentid=10 extension added to link.
I just want only users own gadgets shown at dropdown on cred form on repeatable zone page.So users will add repetable features to their gadget not other's gadget . They'll use this page hidden link.
Thanks
Unfortunately there is not a good way to filter those parent options yet, so all parent options will be displayed. We're working on a way to expand the options here. The alternative I tried to explain is to create a View of Gadgets filtered by post author (the current User), and include a link to the Repeatable Zone for each Gadget. Something like this:
My Gadget 1 | Add Repeatable Zone (links to URL like repetable-zone?parentid=12345)
My Gadget 2 | Add Repeatable Zone (links to URL like repetable-zone?parentid=67890)
My Gadget 3 | Add Repeatable Zone (links to URL like repetable-zone?parentid=43210)
...and so on...
Then place this list of Gadgets somewhere on your site. Do not link to the repetable-zone page directly in your site menu, only link to it in the list above.
Another option is to include the CRED form directly on the Gadget single page, and this eliminates the need for a special link and URL parameter.