开发者

Developing a content type with a custom variable length field type

I have a content type institute. It has two fields courses, reviews which are custom content type. Courses have fields as Name, Description, eligibility, Seats. An institute can have multiple courses. I want the content editor to fill a form while entering new institute details. It should have options like 'add a course' link to keep on adding the courses the institute offers(say 3 or 4 but not fixed).

How do I go about linking the two content types making courses child o开发者_运维问答f Institute. Also how should I make the form for entering the institute details.


If institute, courses, and reviews are actually all content types, you can use a nodereference field (in CCK to link them together.

For instance, in your "institute" content type, add a nodereference field and allow it to reference the "courses" content type, and choose Unlimited from the "number of values" dropdown (so you can add any number of courses to an institution). Add all other fields you want the "institute" content type to have, then you can go to www.example.com/node/add, choose "institute", fill out all informational fields. The nodereference field will allow you to create a link between the institute type and some courses.

A good explanation on CCK's nodereference can be found at http://pras.net.np/blogs/guide-cck-nodereference

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜