Hi Luo,
thanks for answer, everything ok. Now I can see the thesis of each group but I have another problem.
At the begenning the thesis don't display in the view shortcode, so I investigate in your wordpress and I can see that you have the thesis conected at the investigator, you can see in picture-conected.jpg
Do you do this connection manually?
Because in my website, when a investigator upload a thesis the relation is empty, so I have to make this relation manually, after do this the thesis display in the page of each group.
So, the problem is the connection. You can see in picture-no-conected.jpg
How I can do it automatic each time a investigator upload a thesis from the insert form?
Thanks!
Hello,
You can follow our document to setup a child post form for creating "thesis" post, so when user create new thesis post, it can connect the parent investigator post automatically:
https://toolset.com/course-lesson/selecting-parent-posts-when-using-forms-to-create-child-items/
Hi Luo,
I followed the instructions in the link that you send.
Creating Forms with a Parent Post Preselected, and I created this shortcode:
[cred_child_link_form form='193' parent_id='-1' text='Agregar nueva Tesis' target='_self']
But still not working, the relationship is empty.
I send you some pics of the process.
Thanks.
Please share your website credentials in below private message box, also point out the problem page URL and form URL, I can setup a demo for you
Thanks for the details, since your website isn't in English, it is hard to find the problems.
I have setup a demo in your website, here are detail steps:
1) Edit post form "Formulario para insertar Tesis":
hidden link
in section "Form editor", click button "Add fields"->choose "Investigadores Tesis", display the parent investigador selector field, see line 7~10:
<div class="form-group">
<label><b>Parent INVESTIGATOR</b></label>
[cred_field field='@investigador-tesi-s.parent' class='form-control' output='bootstrap' select_text='--- not set ---']
</div>
See my screenshot
2) Test it in frontend:
hidden link
It works fine, I can see all options in field "Parent INVESTIGATOR", and it is only a demo for your reference, you can customize it with HTML codes.
3) If you want to select parent INVESTIGATOR post automatically, you can display the child post form link shortcode into the single "investigadores" post content, for example: put the shortcode into the content template "Plantilla para Mis datos":
hidden link
[cred_child_link_form form='193' parent_id='-1' text='Agregar nueva Tesis' target='_self']
Hi Luo,
We prefer the option 1, but this is not usable for the investigator, so it could be possible that for not lose the menu options (My thesis > add thesis, My proyects > add proyects... )
Use in ecah insert form this code:
<div class="form-group">
<label><b>Parent INVESTIGATOR</b></label>
[cred_field field='@investigador-tesi-s.parent' class='form-control' output='bootstrap' select_text='<b>ADD AS A DEFAULT VALUE THE INVESTIGATOR NAME OR ID</b>']
</div>
And hide the div with CSS, because the investigator musn't choose another investigator for upload the thesis, in the case that this could be not possible, we choose the 3 option, add this code:
[cred_child_link_form form='193' parent_id='-1' text='Agregar nueva Tesis' target='_self']
in the investigator account, but we lose the functionality of the main menu.
Thanks.
Please check the URL you mentioned above:
hidden link
It is a normal WordPress page, it is not a single "investigadores" post, which "investigadores" post do you want to setup as default value when user click on the link "Agregar tesis"?
Hi Luo,
Ok sorry about that, I mean this URL:
hidden link
Is a "My account" URL, so I see two solutions:
1) Put the shortcode buttons here for each custom post type (Thesis, proyects...) and then the register used click on it and add his CPT with the relationship.
2)Make a way that when a user is logged, click on the main menu (example: add thesis) and fill the form and his thesis his saved with the relationship.
I prefer the second but if there is no way to do it I'll make the option 1.
Is theres a possibility to make the second option?
Thanks.
I assume we are talking about the WP menu:
hidden link
I don't find any menu item which supports shortcode.
If there is some item supports shortcode, you can use Toolset shortcodes in it, and setup the child post form link.
If there isn't, you will need to try option 1)
Hi Luo,
can we make what I send you in the image?
Thanks
No, the URL you mentioned above
hidden link
It is a WordPress page, it is not a single "investigadores" post, so Toolset child form link shortcode can not generate the correct form link for you.
Hi Luo,
I have add the shortcode of add thesis in the investigator's template by toolset:
hidden link
You can see the link under the photo. But it still not add the relationship.
You can see it in the back-office.
I send you images.
Thanks.
You need to add the relationship field into the post form "Formulario para insertar Tesis":
hidden link
line 30:
[cred_field field='form_submit' output='bootstrap' value='Enviar' class='btn btn-primary btn-lg']
See the result here:
hidden link
Hi Luo,
We need another solution for this, it's very important that each investigator can add a thesis without select his name on the form of add thesis, this is not usable and we can't present the project this way.
We tried to add this shortcode in the investigator template:
[cred_child_link_form form='193' parent_id='-1' text='Add Thesis' target='_self'] to avoid that the investigator have to choose his name of the select field:
[cred_field field='@investigador-tesi-s.parent' class='form-control' output='bootstrap' select_text='--- not set ---']
So, is there any option to add a thesis-investigator relationship automatically?
If this field would be like this:
[cred_field field='@investigador-tesi-s.parent' class='form-control' output='bootstrap' select_text='NAME OF THE INVESTIGATOR LOGED BY DEFAULT'] would be ok for us.
Thanks.