Data entry form consisting of different node types

Events happening in the community are now at Drupal community events on www.drupal.org.
barunsamanta's picture

In my Drupal 7 project I have two node types:

  1. Student (Roll_No,Name,Qualifcation)
  2. Courses (Course_Code, Course_Name,Fees,Duration)

First I have added a number of courses - for e.g. Drupal, Magento, CakePHP..

Now I want a simple data entry form called Admission for entering student data where we should get a field "Course

Selected" as a drop-down list showing all the available courses.

I have installed the Relation module (and enabled all the submodules in the pack) and can establish relations between a

particular student and a particular course but want to do it through a simple data entry form all in the same page. Any

help..?

Comments

You can try

amrit_b's picture

You can try http://drupal.org/project/references Its a simplified version of relations and its one directional. Here is a quick tutorial http://www.youtube.com/watch?v=0CHC8I9xZIg

Thanks
Amrit

References -> Entity Reference -> Relation

barunsamanta's picture

Thanks a lot for your guidance but stuck again..
I came upon this module previously...and noticed in the Note section:

"References will most probably be deprecated in the near future in favor of Entity Reference, which should probably be considered first on fresh D7 projects. Another, more radical, alternative would be the Relation module."

That's why I decided to start with the Relation module..however will go through the video you provided..thanks a lot again..

You can use taxonomy terms

susan5in7's picture

Hi barun,

It is very simple. You just use Taxonomy terms. You can follow the simple steps.

  1. Login as Administrator in your drupal 7 site.
  2. Now go to Taxonomy in Admin/structure section.
  3. Click Add Vocabulary and Insert Course Categories in the name field and in description you can leave it blank.
  4. Now under this Vocabulary you can just add all your courses.
  5. Now go to you form and add a field name "Course Category" and choose fiels type is "Term reference" and Widget type is "Select list".

Now just add your data in the desired form you; will find all your categories as dropdown list.

I hope this will solve your problem.

Need a dynamic vocabulary

barunsamanta's picture

Dear Sir,
Thanks a lot for your kind response.

But I need a dynamic list of Courses generated from the database..that means a dynamic taxonomy..but what I found is only a static vocabulary.

your point is not clear

susan5in7's picture

not getting your points. you have to add some more details.
But if you need sub-categories under category then you should create a main term as category and insert other terms under this main term. you will get a dynamic listing box of sub categories. try it.

Taxonomy does not seem to solve what I'm looking for

barunsamanta's picture

As I know, taxonomy is a system of labeling content with categories.
But what I need is a relation between two entities as in:

Table: Student

Roll_No
Name
Qualification

Table: Courses

Course_Code
Course_Name
Fees
Duration

Table: Student-Course

Roll_No
Course_Code
Admission_Date

Form: Admission

Text Box: Roll No (manual for now)
Text Box: Student Name
Text Box: Qualification
Dropdown List: Course_Name (dynamically generated from table:Courses)
Date Picker: Admission Date

When Save is clicked on the form, one row is added to the table:Student and another into the table:Student-Course.
I can achieve a similar thing using the Relation module but unable to create a simple data entry form as I have mentioned.

Worth mentioning, I have created two vocabularies, one Languages & the other named Technologies and displayed them as blocks on the Home page. These guide site visitors to take them directly to content by clicking terms they are interested in, for e.g., e-commerce,PHP,Java,CMS etc.

Sir, need your kind help..

Many ways of doing this.

sumeet.pareek's picture

@barunsamanta : Well first, the right place to have asked this is in the DO forums. Simply because that is the place you should go to, to seek help from a larger drupal community (or drupal.stackexchange.com), and the chances of others of landing on your problems discussion in the future would have been higher there. Perhaps you could have posted a link to your DOforum/stackexchagne question here so that us "local" folks to notice that somebody close by is looking for help and we could have jumped in.

^ Just my 2 cents to direct right queries to the right place :-)

Now, there are many ways of setting up the data architecture for what you need done. The best way would be determined by the overall larger requirements. For now, given what you have already set up the content types courses and students (I would highly recommend for them to be 'user' with role 'student' instead of a content type if these students are actually login in to the site), one way to go about this would be -

  1. Create a new content type called say 'enrollment'.
  2. In that have a node reference field for 'student' (or user reference field if my suggestion in the above para applies). You could make this autocomplete, dropdown whatever.
  3. Then have a node reference field for 'course'. This can also become autocomplete, dropdown etc. This can also become multiple valued field if that fits your requriement.
  4. This way, you can have more fields in 'enrollment' (eg: institute location, etc (date of enrollment can be the node creation date, or a separate field)) if desired.
  5. Also, this way, you get the full power of modules like 'Views' to create any kind of filtered lists of enrolments (by courses, students, time of enrollment) and what not!

Hope this helps.

Node reference type not available

barunsamanta's picture

I'm not getting the 'node reference' type in my project. I have not installed the module 'References' (since Drupal says it will soon be deprecated), instead I'm using the 'Relation' module. How can this be done by the Relation module ?

Moreover, I want the list of Courses generated from the Node Type Courses and not from a vocabulary. Also I want student field as a text box. On submission of the form, a new Student node will be created and a new Enrolment node will be created relating the new Student and the selected Course.

I am also a bit confused using Enrolment as a node type because Enrolment seems to be a relation between two node types Student and Course.

Regarding the student-user issue, I plan to create node types as Student,User,Role.

The Role node will contain Role types - Roll Id, Roll Type.
The User node will contain User Id, Roll Id, password, status etc.
The Student node will contain student details such as Name, Address...and User Id..

Kindly help..

Yes, agree with Mr Pareek

susan5in7's picture

Hi barun,
Now I understand your requirement. Your requirement is very simple. Instead of creating different content types you just create one contente type as "enrollment" as stated by Mr. Pareek. You use your dropdowns as I told you earlier. now you have to create different types of views (page or block) by choosing the desired fields from "enrollment" content types.

Then in a view by using Contextual Filters & Relationship (in advanced section of a view) you can pull out your desired results.

Hope this will help.

If not done, reply back. I will create it in my drupal codes site (http://drupalcodes.com) and will send you the link exactly what you need. But you have to register in my site to view.

Still not clear

barunsamanta's picture

Sir,

Still not clear with the instructions provided by Mr Pareek..need your help..I have created my account on drupalcodes.com

Regards,
Barun

Just post this discussion

susan5in7's picture

Hi barun,
Now just post this discussion at http://drupalcodes.com/node#overlay=node/add/create-discussion

Meanwhile I will create your contents and discuss there because not possible to add any contents here. Remember there are paid drupal learner (paid user) in my site who will also see your discussion.

Your Enrollment report is ready

susan5in7's picture

Hi Barun,

I have created your enrollment form and report. You can see in the following link.

For form : http://drupalcodes.com/node/14#overlay=node/add/enrollment
For Report : http://drupalcodes.com/enrollment

I hope this is exact your requirement.

Still confused

barunsamanta's picture

Thank you sir..
visually and functionally it seems to be correct.

But what I find here, Student is a node type but MBA is a taxonomy term. But I need Courses as a node type. If a Course has Subjects, then Subject would also be a node type, not a taxonomy. Then want to establish relations between them. Although, apparently the current solution seems to be ok, I would like to walk the way of Entity-Relationships. Relation between nodes (in case of Courses) may be hierarchical for eg just like the adjacency list model. I'm still confused.

Regards Barun

out of town

susan5in7's picture

hi barun

if you still need the relationship between nodes, i will guide you how to establish 2 nodes in relation. i am out of town for 2 days. will discuss the issue later.

First you have to login

susan5in7's picture

@Barun
Remember, you have to login first and then u'll able view or insert data. Try it.

Kolkata (Calcutta)

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: