Des i gni ngabl oggert empl at ef r om s c r at c hi sno tasdi ffic ul tasy oumi ghti magi ne.Ihadt o s ear c har oundal o tofwebs i t esanddi dal o tofgoogl i ngt ofi ndoutho wt obui l dac ompl et e bl oggert empl at e.T ur nsouti ti spr e t t yeas yt obui l di ty our s el f ,buty ouneedt ok nows ome s t uff sbe f or eh an d.Th et h i n gi s ,y o un eedt ou nd er s t a ndho wi twor k san ds ho ul dha v ea n i de ao fho wy o urb l o gs ho ul dbe.
I st hi sf ory ou? Theabo v equ es t i onde pen dsma ma i n l yo ny o urwe bd ev e l o pme nts k i l l s .Yous ho ul d ha v es omebas i cwebd es i g ni n gs k i l l s .Youne edno tb eama s t eri nwe bd es i gn,b ut s o meba me s i ck n o wl e dg eo fCSS,HTML ,J a v a Sc r i p t&a wa r e ne s so fXMLwi l l d o.Yo u c anl ear nt hebas i c soft hes et ec hnol ogi esat w3 s c ho ol s . c o m
Howbl oggerwor ks?
How Bl oggerWor ks ?
Wh enwes ub mi mi tt het e mpl mp at eXHTMLc o det ot h eb l og geri ti ss t or edi nt h eb l og ger dat abas e.Whent hebl ogi sr eques t edvi aabr o ws er ,t heBl oggerPar s erpar s est he c o dean ds e nd sb ac kt h eHTMLou t p uto ft h ep ar s e dXMLc o dewh i c hwi l l b e di s pl ay edi nt hebr ows er .
TheBasi cLayout
<#$ml xmlns=4#$$((222.2*.org(1555(x#$ml4 xmlns6=4#$$((222.google.com(700(gml(64 xmlnsd9$9=4#$$((222.google.com(700(gml(d9$94 xmlnsexr=4#$$((222.google.com(700(gml(exr4 > <#e9d> <$i$le><($i$le> <(#e9d> <6od:> <(6od:> <(#$ml>
Bl o gg ert empl at ei sf ul l yc od edi nXHTMLan dBl ogg erEl e men t s .I nt hea bo v ec od e wehavedefinedasetofxml ns( XMLNamespace)whi char edefinedbyGoogl ef or xmlns6; xmlnsd9$9; xmlnsexr u s ewi t hbl o gg er .Na me s pa c es u c has l et sus de s i gno urbl o gge rwebp agea nda l s ot og etd at af r o mt heb l og gerd at a bas e . •
xmlns6 -ac c es st hebl oggerel ement s
•
xmlnsd9$9 -i swher et hedat aoft hebl ogc omesf r om
•
xmlnsexr -i sus edt oc al c ul at eex pr es s i onf orat t r i but es ( wi l l s eet hi ss oon) .
Not e:Youcanchanget heabov enamespacenamef r om 6 t o6log ord9$9 t od at any t i me.Buti t ’ sbes tt os t i c kwi t hwhati sdef aul t .
Bef or ey ouc ont i nue -SkipThi s Bef or emo vi ngal ong,ha v eabr i efl a y outofhowy o urbl ogs houl dl ook .Sk e t c ha l ay outofy ourbl og’ sst r uc t ur e.T ak eapi ec eofpaper ,s t ar tdr awi ngt hel ay outory ou c oul dus eappsl i k el uc i dc har tandwi r ef r amet hedes i gnt haty ouwanty ourbl ogt o be.I dent i f yel ement sl i k e, • • •
Wher eshoul dt hemenucomeandhow shoul di tl ook. Howwi l l t hepos t sappear ,i si ta2c ol umnor3c ol umnl a y out . Wh er es h ou l dt h ewi d ge t sap pe are t c .
Sec t i on TheBl oggert empl at el ay outi sdes i gnedwi t hSec t i ons .Sec t i onsar et heone ’ swhi c h mak est hel ay outoft hewebpage( l i k eheader ,f oot er ,s i debaret c . ) .I ti sl i k et he s e c t i o nsi nHTML 5.
Sect i onsi nbl ogger
Ab ov ei ma ges h o wss omes amp l ewe bp ag el a y o u t swh i c hwi l l g i v eyo ua ni d eao f wh atas ec t i o no fawe bp ag emi g htb e.
Sec t i onSy nt ax Th es y n t a xt oc r e at eas e c t i o ni nb l o gg eri ss ho wnb el o w.Th er ec a nb ea nyHTML c odear oundt hes ec t i onc ode,butt her ec an' tbean yHTMLi ns i det hes ec t i onc ode. dget T od efi net hec on t en t soft hes ec t i o nwemu s tu s et heWi el ementi nbl ogger , whi c hwi l l bedi s cus seds hor t l y . Eac hs ec t i ont aghast hef ol l owi ngs y nt ax ,whi c hi ss i mi l art oanHTMLel ementwi t h at t r i but es . <6sec$ion id=44 cl9ss=44 m9x2idge$s=44 s#o29ddelemen$=44> <(6sec$ion>
Eac hat t r i but eshav edi ff er entmeani ngs ,t hatwi l l bepar s edbyt hebl oggert or ender t heel ement sfi nal out put .
Sec t i onAt t r i but es •
i d( Requi r e d) -Auni quename,wi t hl et t er sandnumber sonl y .
•
cl a ss( Opt i onal ) -Commonc l as snamesar e' na vbar , ' ' header , ' ' mai n, '
' s i debar , ' and' f oot er . ' I fy ous wi t c ht empl at esl at er ,t hes enameshel pBl ogger det er mi neho w bes tt ot r ans f ero v ery ourc ont ent .Howe v er ,y ouc anus edi ff er ent names ,i fy oul i k e. maxwi dget s( Opt i onal ) -Themaxi mum numberofwi dget st hatcanbeadded
•
i nt hi ss ec t i on.I fy oudon' ts pec i f yal i mi t ,t her ewon' tbeone. showaddel ement ( Opt i onal ) -Canbe' y es ' or' no, ' wi t h' y es ' ast hedef aul t .
•
Thi sde t er mi neswhe t hert hePag eEl eme nt st abwi l l s ho wt he' AddaPageEl ement ' l i nki nt hi ss ec t i on.Ha veal ookatt hei mages hownbel ow,
Se c t i on-" s howa dde l e me nt "a t t r i but e
•
gr owt h( Opt i ona l ) -Canbe' hor i z ont al ' or' v er t i c al , ' wi t h' v er t i c al ' ast he
def aul t .Thi sdet er mi neswhet herwi dget swi t hi nt hi ssec t i onar ear r angeds i deby s i deors t ac k ed. As ec t i onc anc ont ai nwi dget s .I tc annotc ont ai not hers ec t i onsoranyot herc ode.I f t her ei saneedt oaddac odear oundori ns i deas ec t i on,t hes ec t i onmus tbe s epar at edi nt ot wodi ffer ents ec t i ons .
Ex ampl eCode <6sec$ion id=4#e9der4 cl9ss=4#e9der4 m9x2idge$s="1" s#o29ddelemen$="no"> <(6sec$ion> <6sec$ion id=4m9in4 cl9ss=4m9in4 m9x2idge$s="1" s#o29ddelemen$="no"> <(6sec$ion> <6sec$ion id=4oo$er4 cl9ss=4oo$er4 s#o29ddelemen$="no"> <(6sec$ion>
Not e:Bydef aul tt her emus tbeatl eas tt wob: s ec t i ont agsorel s ebl oggerwi l l t hr ow aner r or .
Wi dgetTags
Sec t i onsar emademai nl yus i ngwi dget s .Sec t i onsar ej us tl a y outel ement s ,wi dgeti s wi t hwhi c ht her eal dat ai sdi s pl ay ed.Awi dgetati t ss i mpl es tf or m,i sj us tas i ngl e t ag,whi c hi sapl ac ehol derf orwhats houl dappeari nt hepageel ement .Ther ear e s omedef aul twi dget sav ai l abl ei nbl oggerandac us t om wi dge tc anal s obec r eat ed. Thedat af ort hewi dge ti ss t or edi nt hebl oggerdat abas eandi sac c es s edonl ywhen t hewi dgeti st obedi s pl ay ed.
Wi dgetSynt ax <62idge$ id=44 loced=44 mo6ile=44 $i$le=44 9geT:e=44 $:e=44 (>
•
i d( Requi r e d) -Ma yc ont ai nl et t er sandnumber sonl y , andeac hwi dgetI Di n
y ourt empl at es houl dbeuni que.Awi dge t ' sI Dc anno tbec hangedwi t houtdel e t i ng t h ewi d ge ta ndc r e at i n gan ewo ne . •
t y pe ( Re qui r e d) -I ndi c at eswhatk i ndofawi dgeti ti s ,ands houl dbeoneof
t hev al i dwi dgett y pesl i s t edbel ow. Thev ar i ouswi dge t st y pesar e, Bl ogAr c hi v e
o
Bl og Feed Hea der HTML Si n gl eI mag e Li nk Li s t
o o o o o o o o o o o o •
Li s t Logo Bl ogPr ofi l e Nav bar Vi deoBar NewsBar l oc ke d( Opt i ona l ) -Canbe' y es ' or' no, ' wi t h' no' ast hedef aul t .Al oc k ed
wi d ge tc a nn otb emo v e do rd el e t e df r o mt h ePa geEl e me nt st a b.
Pa geEl e me nt-Wi dge t' l oc ke d'a t t r i but e
•
t i t l e( Opt i onal ) -Adi s pl ayt i t l ef ort hewi dget .I fnonei ss pec i fi ed,adef aul tt i t l e
s uc has' Li s t 1' wi l l beus ed. •
pageType( Opt i onal ) -Canbe' al l , ' ' ar c hi v e, ' ' mai n, ' or' i t em, ' wi t h' al l ' ast he
def aul t .Thewi dgetwi l l di s pl ayonl yont hedes i gnat edpagesofy ourbl og.( Al l wi dget sdi s pl ayont hePageEl ement st ab,r egar dl es soft hi erpageT ype. ) •
mobi l e ( Opt i ona l ) -Canbe' y es ' ,' no, ' or‘ onl y ’ wi t h' def aul t ' ast hedef aul t .
Thi sdec i desi ft hewi dgetwi l l bedi s pl ay edonmobi l eornot .Onl yHeader ,Bl og, Pr ofi l e,PageLi s t ,AdSens e,At t r i but i onwi l l bedi s pl ay edonmobi l ewhent hemobi l e at t r i but ei s' def aul t . '
Ex ampl eCode <6sec$ion id="side69r" cl9ss="side69r" m9x2idge$s="" s#o29ddelemen$=":es"> <62idge$ id=4Cs$ome9rc#14 $i$le=4e9rc#4 $:e=4Cs$ome9rc#4 loced=49lse4(> <62idge$ id=4Follo2%:m9il14 $i$le=4Follo2 %: m9il4 $:e=4Follo2%:m9il4 loced=49lse4 (> <62idge$ id=4ol9ros$s14 loced=49lse4 $i$le=4ol9r On 3el9$emein4 $:e=4ol9ros$s4(> <62idge$ id=4&96el14 $:e=4&96el4 loced=49lse4 (> <(6sec$ion>
Th eSy n t a xan dDo c ume nt a t i o ni st a k enf r o mt h eOffic i a lBl o gg erDo c ume nt a t i o n
Th eb as i c<62idge$(> t agwasex pl ai nedi npar toneofBl o gg erT emp l a t eDe s i g n f r om Sc r at c h.I nt hi spos t ,t her ewi l l beadet ai l eddes cr i pt i onofhowwi dgett agc an beus edt oha v eafi negr ai nedc ont r ol ofwhatappear si ns i deoft hewi dge t . Thebas i cf or m oft hewi dgett agc ont ai nsas el fc l os i ngt agwi t ht heat t r i but esr el at ed t oi t . <62idge$ 9$$ri6$es...@ (>
Youc anc ons i dert hes ebas i cwi dgett agsl i k ef unc t i oni nv oc at i on,wher east he defi ni t i onoft hef unc t i oni spr es enti nbl ogger .
ExpandWi dgetTempl at e J owi dget T ov i ewt hec ont ent soft hedef aul twi dget s ,us et h e umpt dr opd owni nEdi t HTMLpa ge ( T e mp l a t e>Ed i tHTML ) .Ch oo s ean yo neoft h ewi d ge t .On c ey o ur e ac h t hewi dgetc ode,pr es st hebl ac kt r i angl ear r owi nt hel i nenumberal i gnedt ot he wi d ge tc odet ov i e wt h ewi dge tc ode .
Expandwi dget
Cr eat i ngCust om Wi dget T oc r e at eac u s t o m wi d ge t ,wene edt oma k es omec ha ng est ot h ewi d ge tt a g.
Fi r s twenee dt oh av eao pen i ngan dc l os i n gwi d ge tt ag . <62idge$ 9$$ri6$es...@ > <(62idge$>
Mos toft hewi dge tt y pess pec i fi edi nt hepr e vi ouspos tar edefi nedb ybl ogger .T o c r eat ec us t om c ont enti nt hewi dget ,us et heHTML t y pe.
Ex ampl e: <62idge$ id=4,T&14 $:e=4,T&4> <(62idge$>
Not e:Fort hei doft hewi dget ,i t ’ sbes tt opr ov i det hei doff or mat-{ t y pe} { di gi ts t ar t i ng f r om 1f oreac hwi dge t } .Fore xampl e,i fac us t om c ont ac tandl abel swi dgeti s c r e at e d,t h ei rr e s pe c t i v ei d ’ swo ul db eHTML 1a ndHTML 2wi t ht y p eHTML .
<62idge$ id=4,T&14 $:e=4,T&4 loced=4:es4 $i$le=4Con$9c$ Us4>)idge$ code #ere...@<(62idge$> <62idge$ id=4,T&74 $:e=4,T&4 loced=4:es4 $i$le=4&96els4>)idge$ code #ere...@<(62idge$>
I nc l udeandI nc l udabl e i nc l udabl e” T od efi n et h ec o nt e nto ft h ewi d ge tt a g,weu s eat a gn ame d“ .A e xpanded/ c us t om wi dgett agmus tc ont ai nonl yi nc l udabl et agsi ns i dei t .
I nc l udabl ehast wopar t s , •
•
i nc l ude -i si dent i c al t oaf unc t i onname.Whent hi si si nv ok ed,t hepar t i c ul ar
i nc l udabl ewi l l bec al l ed. i nc l udabl e -i si dent i c al t oaf unc t i ondefi ni t i oni . et hebodyoft hef unc t i on.
I nc l uda bl e
I nc l udabl eSy nt ax <6incld96le id=4niAe'd4 v9r=4d9$9For)idge$4> ,ere 2e c9n l9ce 9n: iece o code@ <(6incld96le>
I nc l udabl eAt t r i but es •
i d( Re qui r e d) -Auni quei dent i fi ermadeupofl e t t er sandnumber s .
•
v ar( Opt i onal ) -Ani dent i fi ermadeupofl et t er sandnumber s ,f orr ef er enc i ng dat awi t hi nt hi ssec t i on.Thi si showwepas sdat ai nt ot hewi dget .Thi si sal s o i dent i c al t oaf unc t i on.
I nc l ude I nc l udesar eus edi fy ouha veas ec t i onofc odet haty ouwantt or epeatmul t i pl et i mes i ndi ffer entpl ac es .Whenai nc l udei sus ed,t hatpar t i c ul ari nc l udei sr epl ac edwi t ht he c ont ent soft hei nc l udabl e.
Ex ampl e <6incld96le id=4m9in4> <6loo v9r=4i4 v9les=4os$s4>
<6inclde n9me=4os$4 d9$9=4i4(> <(6loo> <(6incld96le>
<6incld96le id=4os$4 v9r=44> Ti$le <(6incld96le>
I nc l udeSy nt ax <6inclde n9me=BidOT#e'ncld96leB d9$9=Bd9$9For'ncld96leB (>
I nc l udeAt t r i but es •
•
name( Requi r ed) -Ani dent i fi ermadeupofl et t er sandnumber s .I tmus t mat c ht heI Dofane xi s t i ngb: i nc l udabl ei nt hes amewi dget . dat a( Opt i onal ) -Anex pr es s i onorpei c eofdat at opas sont ot hei nc l udabl e s ec t i on.Thi swi l l bec omet hev al ueoft hev arat t r i but ei nt hei nc l udabl e.
Def aul tI nc l udabl e Ev er yc us t om wi dgetmus tc ont ai nai nc l udabl ewi t h“ i d”equal t o“ mai n” ( mai n i nc l udabl e) .Thi smai ni nc l udabl ewi l l c ont ai nt hec ont entf orent i r et hewi dget .I nf ac t , t hi si st heonl yi nc l udabl ey ouneedt os pec i f yt hec ont ent soft hewi dget .I fy ouneed, y ouc andefi nemor ei nc l udabl e ’ si ns i det hewi dgetandout s i det hemai ni nc l udabl e, andi nc l udei ti ns i det hemai ni nc l udabl eus i ngt he“ i nc l ude”el ement . Ev eni fy ouhav emor ei nc l udabl e’ swi t hdi ffer enti d’ si twi l l notbedi s pl ay ed aut omat i c al l yi nt hewi dget .Youneedt os pec i f yi ti ns i det hemai ni nc l udabl eus i ng t he“ i nc l ude”el ementwi t hr ef er enc et ot hei nc l udabl ei d. I fy ouha v ee xper i enc ei nCPr ogr ammi ng,t her ewi l l beamai n( )f unc t i ont hat Dodl e: wi l l bec al l edfi r s tf ort hes t ar toft hepr ogr am ex ec ut i on.Cons i dert hemai n i nc l udabl e( i d=’ mai n’ )ast hemai n( )f unc t i oni nCPr ogr ammi ngf ort hewi dget .
Wi dget
Ex ampl e: <62idge$ id=4,T&14 $:e=4,T&4 loced=4:es4 $i$le=4&96els4> <6incld96le id=4m9in4> <#*>&96els<(#*> <6inclde n9me=4l96els4><(6inclde> <(6incld96le> <6incld96le id=4l96els4> <l> <9 #re =44 $i$le=4,4>,<(9><(li> <9 #re =44 $i$le=49v94> 9v9<(9><(li> <9 #re =44 $i$le=4C4>C<(9><(li> <(l> <(6incld96le> <(62idge$>
Youc anpl ac et heabo v ewi dge tc odei ny ourbl oggert empl at et ov i e wt heout put .