Tell us what you are trying to do?
The goal is to allow the user to create a Alumnos (students) and a Memoria (Memory) in two steps (without PHP code for creation), ensuring that the Memory is automatically linked to the newly created Student and inherits the "Camada" (graduation year) Taxonomy.
Alumnos CPT is related with Memorias CPT as one-to-many and both shared the "Camada" taxonomy.
I've created an input form with Alumnos including de camada taxonomy
My idea is that upon submission of this form, it redirects to the page containing the "Memoria" creation form, and this form passes the parameters to link it to the Alumno and Camada.
However, I couldn't find a way to do this using the form editor.
Welcome to Toolset support, If you want to achieve this, Submit Alumno ➜ land on that Alumno’s single page ➜ show a Memoria form there that is already linked to this Alumno and pre-filled with the Alumno’s Camada.
Then you need to do as follows:
Step 1 — Alumno form
Build a normal post form for Alumno and include the Camada taxonomy field.
Step 2 — After submit action
In the Alumno form Settings → After visitors submit this form, choose Go to the post (i.e., the newly created Alumno single).
Step 3 — Put the Memoria form on the Alumno single template
Edit the single-Alumno (or its Content Template) and insert the Memoria create form on that page.
Step 4 — Auto-link the parent (Alumno)
In the Memoria form, include the relationship/parent field (e.g. @alumno-memoria.parent) and set it to use the current post as the parent.
Step 5 — Pre-fill Camada on the Memoria form from the current Alumno
Add the Camada taxonomy field to the Memoria form and set its default from a shortcode that reads the current page’s term (the Alumno page you’re on). For example, set default to the term slug via:
Now, the User creates Alumno → WordPress opens the new Alumno page → the Memoria form on that page already knows the parent Alumno and has Camada pre-selected to match the Alumno’s Camada.
Thank you for the video. That is strange. I can try myself and see if I can find why this is happening. I'd appreciate it if you could give me the URL/User/Pass of your WordPress dashboard after you make sure that you have a backup of your website.
It is absolutely important that you give us a guarantee that you have a backup so if something happens you will have a point of restore.
Christopher is on vacation. This is Minesh here and let me jump in here.
I would like to know why you assigned year taxonomy to both post types?
Can I have workflow and problem URL and step by step information on what page you added your form and where exactly with what link you stuck. Please share all required informtion with URLs and share details whats your expected result on what URL.
I have set the next reply to private which means only you and I have access to it.
This is a school, and students graduate every year. The "Camadas" (Graduation Classes) taxonomy is what groups these students by their graduation year.
The idea is that a student can add themselves as such by leaving their first and last name, email, and graduation year ("Camada" taxonomy).
And then, they can add an anecdote from their time at the school (CPT "Memories").
The goal is that, if a student belongs to the 1975 class, for example, all the anecdotes they upload to the web will be grouped under the same class (1975). This way, I can later view the archive of all the memories that different students from the 1975 class have uploaded.
I could also view an archive of the students for each class.
This is the page with the form to enter a student's data: hidden link
When the data is submitted, I direct them to their student page, just as Christopher explained. I added a link there to "Add an anecdote," and this takes them to the page with the anecdote submission form.
The student's name is perfectly associated with that anecdote. What I haven't been able to achieve is for the same "Camada" (class) category to be assigned to the "memoria" as well.
[cred_child_link_form form='2890' parent_id='-1' text='Agregar nueva anécdota' target='_self']
With
<a href="/formulario-para-crear-memoria/?parent_alumno_id=[wpv-post-id]&camada_id=[wpv-post-taxonomy type='camada' format='id']">Agregar nueva anécdota</a>
Then with the following form:
- hidden link
I've added the following custom JS:
jQuery(document).ready(function($) {
// Helper function to get URL parameter
function getUrlParam(name) {
const results = new RegExp('[?&]' + name + '=([^&#]*)').exec(window.location.href);
return results ? decodeURIComponent(results[1]) : null;
}
// Get camada_id from URL
const camadaId = getUrlParam('camada_id');
if (camadaId) {
// Set the value in the select named "camada[]"
const $select = $('select[name="camada[]"]');
if ($select.length) {
$select.val(camadaId).trigger('change');
}
}
});
Now, when I visti the following page:
- hidden link
And click on the link "Agregar nueva anécdota", it redirect me on the following page:
- hidden link
And I can see the camada taxonomy option value is pre-selected.
Do you want this solution or you want to hide the camada taxonomy on the above memory page and attach the taxonomy via cred hook.