Xav txog kev siv cov microdata (microdata) muab koj lub xaib kom muaj nuj nqis thiab pom kev ntxiv rau cov tshawb nrhiav.
Microdata lossis "microdata" yog kev tsim kho tshiab uas tau coj mus rau lub ntiaj teb lub ntiaj teb nrog kev tshaj tawm ntawm kev hloov kho tshiab ntawm tus qauv HTML5. Microdata yog qhov sib ntxiv ua ke ntawm cov ntawv HTML niaj zaus, yog cov npe txhim kho lub npe, thiab ua raws cov ntsiab lus ntawm lub vev xaib. Lub hom phiaj ntawm microdata yog ua kom cov ntawv tsis yog sau ntawm cov lus xwb, tab sis muab nws cov ntsiab lus ntau dua. Qhov no txhais tau tias kev tshawb nrhiav neeg hlau, tshuaj xyuas cov ntsiab lus ntawm koj lub xaib, yuav muaj peev xwm los tsim thiab ntsuas qhov sib txuas ntawm cov khoom uas koj xav kom taw nws. Suab nyuab dhau lawm? Cia peb saib ib qho piv txwv, thiab txhua yam yuav pom meej thaum lub sijhawm.
Koj host ib qho kev tshwm sim thiab tshaj tawm txog nws hauv koj lub vev xaib yam tsis siv semantic markup thiab microdata. Tau kawg, tus neeg tshawb xyuas neeg hlau yuav pom cov ntsiab lus hais txog qhov kev tshwm sim hauv cov ntawv nyeem thiab muab tso rau hauv qhov tshawb pom thaum tau thov. Tab sis hnub tim, qhov chaw, hom xwm txheej, tshawb cov neeg hlau, feem ntau yuav tsis muaj peev xwm txiav txim siab, thiab cov ntaub ntawv no tuaj yeem ploj ntawm tag nrho cov ntaub ntawv ntawm nplooj ntawv. Thaum siv microdata, koj tus kheej qhia meej tias yam xwm txheej twg, thaum twg thiab nyob qhov twg.
Piv txwv, qhov teeb meem ntawm kev tshawb fawb rau qee tus menyuam cov xwm txheej. Lub vev xaib sab saum toj tsis siv lub peev xwm ntawm lub cim xaib, thaum qhov chaw hauv qab ua. Koj puas pom qhov txawv? Hauv rooj plaub thawj zaug, koj yuav tsum nyeem cov ntawv thaiv kom paub cov ntsiab lus, thiab hauv rooj plaub thib ob, koj pom tam sim koj xav tau dab tsi.
Thiab qhov no tsuas yog ib qho piv txwv ntawm kev siv cov microdata. Qhov tseeb, lawv cov ntawv thov muaj ntau dua, thiab muaj txhua qhov laj thawj ntseeg tias muaj pes tsawg tus siv thiab tus lej ntawm cov chaw microdata tsuas yog loj hlob.
Nws ua haujlwm li cas? Nws yog qhov yooj yim heev, tsuas yog ntxiv ob peb lub tshuab nyeem tawm kom pom tus cwj pwm HTML li niaj hnub. Piv txwv, qhov no yog dab tsi peb markup yuav zoo li tsis muaj microdata:
Cov menyuam yaus ua tau zoo "Lub Nutcracker" yuav muaj nyob rau lub Kaum Ob Hlis 22 thaum lub Olympic Sports Complex hauv Moscow.
Thiab zoo li no - nrog microdata:
Ntau tus cwj pwm tshiab tau ntxiv rau cov ntawv tseem ceeb html ntawm no:
- itemscope - teev qhov kev txiav txim siab ntawm microdata thaiv;
- itemtype - teev hom microdata;
- itemprop - teev cov khoom tau piav qhia los ntawm microdata.
Piv txwv, hauv peb qhov xwm txheej, tshawb nrhiav neeg hlau yuav nthuav tawm cov ntaub ntawv hauv qab no:
- cov ntaub ntawv hom: kev tshwm sim;
- title: Cov Txiv Ntsuas Dej;
- hnub tim: Kaum Ob Hlis 22;
- qhov chaw: SC Olympic.
Thiab cov neeg nrhiav neeg hlau yuav tuaj yeem tsim cov ntaub ntawv no thiab nthuav qhia rau tus neeg siv khoom hauv daim ntawv yooj yim coj los thov. Nyob ntawm hom microdata, qhov no tuaj yeem muaj peev xwm ntxiv ib qho kev tshwm sim rau daim ntawv qhia hnub, lossis ntxiv tus neeg kev sib cuag rau phau ntawv chaw nyob, lossis xaj khoom, lossis yuav khoom dav hlau / tsheb ciav hlau / daim pib caij tsheb npav, thiab lwm yam.
Tab sis tus neeg hlau tshawb puas paub dab tsi ntawm lo lus "xwm txheej" yog? Txhawm rau ua qhov no, koj yuav tsum tau soj ntsuam ib qho kev pom zoo kom txhua tus siv lub oin thiab tib yam thiaj li hu. Ib "phau ntawv txhais lus" los ntawm cov uas koj tuaj yeem xaiv cov hom kev tsim nyog ntawm microdata. Tam sim no, cov phau ntawv txhais lus no yog lub vev xaib schema.org thiab ob peb lwm qhov chaw uas khaws feem ntau lees paub microdata phau ntawv txhais lus.
Txhawm rau siv cov phau ntawv txhais lus no, koj yuav tsum xub xaiv cov ntaub ntawv tsim nyog. Cov ntaub ntawv hom yog teev tseg raws li URIs. Piv txwv li, rau ib qho kev tshwm sim, hom tsim nyog los ntawm phau ntawv txhais lus yuav "Qhov Xwm Txheej" nrog URI "https://schema.org/Event". Qhov chaw nyob no yuav tsis coj mus rau nplooj ntawv tiag tiag hauv Is Taws Nem, nws tsuas yog siv los txheeb xyuas hom microdata.
Yog li, yog tias peb sau dua peb cov piv txwv uas siv cov lus nquag, peb tau txais cov cim hauv qab no: