Skip Navigation

[Waiting for user confirmation] Assistance with CPTs and Taxonomy Configuration for Student/Alumni system

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 5 replies, has 1 voice.

Last updated by Minesh 1 day, 6 hours ago.

Assisted by: Minesh.

Author
Posts
#2822362

Tell us what you are trying to do?
The CPT "Memorias" will be designed to record anecdotes and stories, allowing users to share their experiences. This CPT will include fields for the anecdote's title, detailed content, and will be linked to the "Camadas" taxonomy to categorize stories by graduation year.

The CPT "Alumnos" will store student information. Essential fields will include name, surname, and email address. The particularity of this CPT is that, when entering a new student, the system will search for matches with existing records. If the student is already registered, a new entry will not be allowed. Otherwise, the registration will proceed. This CPT will also be associated with the "Camadas" taxonomy, allowing each student to be linked to their graduation year.

The CPT "Profesores" will contain teacher data, such as name, surname, and possibly the subjects they teach or the years they were active. Like the other CPTs, it will be integrated with the "Camadas" taxonomy to allow searching for teachers by the year they taught a particular "Camada"

The "Camadas" taxonomy will be a numeric taxonomy, whose main purpose is to represent the students' graduation year. The fundamental characteristic of this taxonomy is its uniqueness: each graduating class year (for example, "1984") can only exist once, avoiding duplications and maintaining data integrity.

To facilitate user interaction and data entry, an anecdote entry form will be created. This form will allow users to add a new "Memoria," requesting the author's name, surname, and email address. A crucial field on the form will be the selection of the "Camada" (school graduation year). When entering the year, the system will verify if the "Camada" already exists in the taxonomy. If the year is not registered, it will be automatically created as a new term in the "Camadas" taxonomy, ensuring that all relevant graduation years are properly classified.

In summary, this content architecture seeks to establish a robust and well-structured system for organizing and managing information related to stories, students, and teachers, using the "Camadas" taxonomy as a central axis for data navigation and categorization.

I have the following doubts:

The form would be registering or choosing a student from the "Alumnos" CPT, registering a "Memoria" and registering which year both the student and the story belong to.
How do I make the "Camadas" taxonomy only accept numbers and be unique?
In the form, when one writes the student's name, if it exists, it should automatically connect them with their "camada" and, when published, the content of the anecdote, which is a field of the "Memorias" CPT, should also be connected to the same "camada" as the student. How do I do this in Toolset?

Is there any documentation that you are following?
Yes, I followed the tutorials

Is there a similar example that we can see?
no

What is the link to your site?
hidden link

#2822649

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

With Toolset, regarding the taxonomy, you can display the taxonomy as multiple checkboxes of dropdown select.

As you shared, user will input the taxonomy value, do you want to allow user to input the year value to textbox and then check the input textbox value (year) against the existing year?

Is it ok for if the taxonomy display as multiple checkboxes or as dropdown select from where they can select/chose the year value and if year value is not present then they should be allowed to add one?

#2822657

The "camadas" range from 1958 onwards to the present day. Since I don't know if they'll write about every "camada", I think it's better to add the years as they begin to write about each one.

There are 67 different years, so a drop-down menu or a field where they can type the year would definitely be better.

#2822662

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

You can able to display the taxonomy field as select drop-down. For typing, it will have more issues and checks rather I suggest you offer select dropdown or multiple checkboxes so user can select the predefiend year from the options.

If you do not want to use taxonomy, you can also check if you want to use the custom select field as well. You can go ahead and give a shot and check which will be better for you taxonomy or select custom field or input number field.

#2822675

Perfect, regarding the “Camadas” I will make a drop-down menu with the years already defined.

I have another question now:

If the 'alumno' is new, when they publish an anecdote, both the 'alumno' and the 'memoria' must belong to the same 'Camada' (year/cohort). How do I assign the same year to both the 'alumno' and the 'memoria' (anecdote)?

If the student already exists, when they're found in the form, it should show them the 'camada' they already belong to. When they publish this new anecdote, it should also assign that 'camada' to the 'memoria'.

#2822993

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - you can write that business login using the Toolset form hook "cred_save_data".
- https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data

Alternatively, you can also use the Toolset form hook "cred_submit_complete":
- https://toolset.com/documentation/programmer-reference/cred-api/#cred_submit_complete

You can check for if the entry is new (not exists already) then write the code to attach the selected term, if exists write the code as required fetch the year and attach the term accordingly.