Working with CCK

With all the options enabled, we can now go ahead and create a new content type. Actually, it is possible to create new content types without the use of CCK, it's just that the new content types will look pretty much like the standard content types already available, because there are no really interesting elds to add.

Head over to Content types under Content management and select the Add content type eld to bring up the following page:

Content types List g^i -.■. . I P<elds Export Import

To create a new content t^pe, enter the human-readable name, (tip machine-readable name, and all other relevant fie'ds That are &n this page. Once created. users d your srte w;ll be able w traate costs that are instances of this content type.

ldentifi cation HMHQ!

Endangered Suenes

Thr h-uman-itidéela r,imt of ".till oo^tflrit typtf. Thir tt.-t xill bfr c :rl jyed pirt of th< 1st tn the dMtntlVfi, tHjj himi muí! baflln vtth * ¿bpitil littwr «ctd ¿antaln only lirtin, i>umb«'t, «nd ipicm This r.arnt nnuit b* unlquo.

lype:

species j f'i h tin f typ Thif tfr^t vi.I L t ■' - r 'i Íír ^^rirtrvítin^th^ 1li fff thfr

¿nlata ísftbut p jot for thu íont*nfc VP'-- Thu ror 11 «r,ujt :o-nbflin only lettflri. numhíi:. and wnJfteuriej. UndeTjíar*; Im to^y-nts-d into hyphtm v<h*fi eeflftrurtino th* URl of thu íw^hI

Desrriptinn:

Previ cíes chí vital statistics of spe-r.i^s found the endangered list.., a «f (Mr (íntí^t tvp*. Th|( n.i ^iii if, ■ 4lipl«v«d m ^ th* lili -»n

Chapter 7

The identification section is pretty straightforward. You can go ahead and fill in whatever new content settings are appropriate. Of special interest is the Submission form settings below this that allows you to decide whether the default Title and Body fields should be changed or even retained (in the case of the Body field):

Submission form settings Title field lohel:

Common name

Sody fjplii label;

To- omit rh* bod-y fi*ld fo' this conttnc Type, rurn-ov* t«--.c md Ictvs this field M-snV

Minfaium number ot words: Q fldj

The m'^irTiLrn* numbii 1.1-J: tor the boJy ^'eltf to ba considered valid th's content tvp*. Thi* can ba useful to rule out submissions thvt do- not m«at -the !LLfer\djrdf. -Tuch n short test pOiti lariat tan cr submit ii.in guideline?;

Th-lf tavt viII be displayed At ttia tap pf tha submiffi-pn form fai thlj content typa. Jt if u^cfu: to-htlplng or liltf^iting ^flur Vlt'f,

In the case of the Endangered Species content type, it doesn't really make sense to have a species Title, rather a Common name makes more sense. Leaving the. Leaving the Body eld label blank will cause this eld to be omitted completely in the event that it is not suitable for the type of content you have in mind.

Advanced Content

You may have noticed that there are several additional tabs to the right of Add content type tab that provide additional functionality. These options are discussed a little later on in this section. So for now, go ahead and fill out the Name, Type, and Description fields and click Save content type to add this to the default list:

Content types Add «rrts^jj (yst1 i-":<?i<3s Enpeit impo^

&elow a i-stof a?l the confer-I typBS on ycur siCt.AJI posts Chat exist an your site a*t instances cf one of tfiese content types.

The content ivpe EntSSfj^end ijeoej has been added

NflmQ

Tyjif1 DoscflptJon

^lofi entry Un;i Abkf enir/ is a single post to ¿r online rnurnal, or bkq

Book book

A ijOofr is a page of content, c-rgamzed i-ntti a coMec&on of related entries collectively kn(nwn as a iwcw. a took paae automaCically displays Inks ta adjacent pages, provid ng a simple navigaCcn syster: for orpani!ing and renewing struclurpd content edit dc-ota

Endangered

Species ipOfifü

prp^ides tne vnal statute of fpeyet foundon tne encangered list.,, edit (3G3CTe

We are now ready to begin customizing this new type utilizing whatever options are available—depending on what is or is not enabled. It is possible to customize any type that is available on Drupal, including the default ones like Blog entry or Poll, but to begin with it is best to leave these alone.

To begin working on the new content type, click on edit in the Endangered Species row. We can now look at the various aspects of working with content types, beginning with...

0 0

Post a comment