Tải bản đầy đủ - 0 (trang)
Chapter 5. Creating Menus and Navigation

Chapter 5. Creating Menus and Navigation

Tải bản đầy đủ - 0trang

areinstalledinadefaultJoomlainstallation.Ifwegotothe

MenuManager,wecanseethesesix,asshowninFigure5.1.

OnequickthingtopointoutintheMenuManageristhatyou

editthemenubyclickingthesmallmenuitemicon,notthe

title,asyoumightthink.

Figure5.1.Xixdefaultmenus

[Viewfullsizeimage]



Thesixmenusareasfollows:

Mainmenu.Containsthemainnavigationforthedefault

content.

Usermenu.Aspecialmenuthatcontainssomefunctions

foruserswhentheyareloggedin.

Topmenu.Aduplicationofsomelinksthatareinthemain

menu.

Othermenu.Containsfouroffsitelinkstositesrelatedto

Joomla.

ExamplePages.Linksdemonstratingthedifferentlayouts.

KeyConcepts.Linkstopagesexplaininglayoutsand

extensions.

TheLeastYouNeedtoKnow



ThismenustructureisonlyJoomla's

suggestionorexample.Iactually

personallycreatedtheexamplepagesand

keyconceptsmenusandcontentaspartof

ateamworkingonJoomlasamplecontent.

It'sverylikelythatthesamplecontentwill

changeandevolveovertimeandreleases.

Thesesixmenusgetinstalledwhenyou

chooseto"installsampledata"duringthe

installation.Inmostcasesyouwillneedto

createyourownorrevisethese.Youcould

evenjustdeletethemandstartoveragain.



Thefirstthingtounderstandisthateachmenuhasatleastone

moduleassociatedwithit.Thismodulecontrolswhereandhow

themenuappears.Forexample,youcouldhaveamodulethat

onlyappearsonthehomepageandintheleftcolumn.

FliptoChapter1,"ContentManagementSystemsandan

IntroductiontoJoomla,"andreadoverthepartabouthowa

ContentManagementSystemisdynamic.Thecontentgets

pulledfromthedatabaseandputinto"placeholders"or

"buckets"onthepages.Awaytounderstandtheprevious

paragraphisthatthemenuisthecontentinthedatabase,and

themoduleisaplaceholderforit.Ifyouwanttopositionthe

menu,youmovearounditsplaceholder(themodule)fromthe

left-handtotheright-handcolumnforexample.Ifyouwantto

managethecontentofthemenu(thelinks),thenyougotothe

MenuManager.

TheappearanceofamenuismanagedthroughtheModule

Manager,forexample,whetheralinkgetsanunderlinewhen

youhover,whatcolorthelinkis,andwhetheritlookslikea



button.Allofthesecharacteristicswouldbedefinedinthe

template'sCascadingStyleSheets(CSS)file(moreonthatin

Chapter9,"CreatingaPureCSSTemplate")andarecontrolled

intheModuleManagerbyusingamodulesuffix(alsoexplained

furtherinChapter11,"CreatingaRestaurantSitewith

Joomla").

Figure5.2showsoneofthedefaultmenusinstalled,the

mainmenu.ShownisthemenuintheMenuManager,its

correspondingmoduleintheModuleManager,andhowitis

presentedinthefrontend.

Figure5.2.Interrelationshipbetweenmenusand

modules

[Viewfullsizeimage]



Thebasicbuildingblocksofthesemenusarethemenuitems.

Eachmenuitemcorrespondstoasinglelinkinthefrontend.

Nextwelookattheimportanceofthesemenuitemsandwhat

theydo.

TheLeastYouNeedtoKnow

Thebackendpartofamenu,wherethe



linksgoandwhattheydo,iscontrolledby

theMenuManager.Thefrontendpartofa

menu,whereitis,andwhatitlookslike,is

controlledbyamenu'smodule.



Chapter5.CreatingMenusand

Navigation

MenusareperhapsthecoreofaJoomlasite.InastaticHTML

site,theymerelyserveasnavigation.InaJoomlasite,they

servethatpurposebutalsodeterminethelayoutofwhata

dynamicpagewilllooklikeandwhatcontentwillappearonthat

pagewhenyounavigatetoit.

Therelationshipbetweenmenus,menuitems,pages,and

modulesisperhapsoneofthemostconfusinginJoomla.This

chapterexplainsthisrelationshipsothatyoucancreatea

navigationschemethatworksforyoursite.

InThisChapter

Thischapterexamineshowthenavigation(menusandlinks)is

builtforaJoomlawebsiteandhowthedifferentaspectsinteract

toproduceacoherentnavigationstructure.Welookateachof

thefollowquestions.

Howdomenusandmodulesworktogether?

Whatdomenuitemsdo?

Whatisabloglayout?

Whatisastandardlayout?

HowcanIchangeamenu'sappearancethroughtheModule

Manager?

HowdoIgetsubmenusordrop-downmenus?



HowDoMenusandModulesWork

Together?

Eachmenuhasamodulethatcontrolswhereandhowthe

menuappearsonapage.Therearecurrentlysixmenusthat



areinstalledinadefaultJoomlainstallation.Ifwegotothe

MenuManager,wecanseethesesix,asshowninFigure5.1.

OnequickthingtopointoutintheMenuManageristhatyou

editthemenubyclickingthesmallmenuitemicon,notthe

title,asyoumightthink.

Figure5.1.Xixdefaultmenus

[Viewfullsizeimage]



Thesixmenusareasfollows:

Mainmenu.Containsthemainnavigationforthedefault

content.

Usermenu.Aspecialmenuthatcontainssomefunctions

foruserswhentheyareloggedin.

Topmenu.Aduplicationofsomelinksthatareinthemain

menu.

Othermenu.Containsfouroffsitelinkstositesrelatedto

Joomla.

ExamplePages.Linksdemonstratingthedifferentlayouts.

KeyConcepts.Linkstopagesexplaininglayoutsand

extensions.

TheLeastYouNeedtoKnow



ThismenustructureisonlyJoomla's

suggestionorexample.Iactually

personallycreatedtheexamplepagesand

keyconceptsmenusandcontentaspartof

ateamworkingonJoomlasamplecontent.

It'sverylikelythatthesamplecontentwill

changeandevolveovertimeandreleases.

Thesesixmenusgetinstalledwhenyou

chooseto"installsampledata"duringthe

installation.Inmostcasesyouwillneedto

createyourownorrevisethese.Youcould

evenjustdeletethemandstartoveragain.



Thefirstthingtounderstandisthateachmenuhasatleastone

moduleassociatedwithit.Thismodulecontrolswhereandhow

themenuappears.Forexample,youcouldhaveamodulethat

onlyappearsonthehomepageandintheleftcolumn.

FliptoChapter1,"ContentManagementSystemsandan

IntroductiontoJoomla,"andreadoverthepartabouthowa

ContentManagementSystemisdynamic.Thecontentgets

pulledfromthedatabaseandputinto"placeholders"or

"buckets"onthepages.Awaytounderstandtheprevious

paragraphisthatthemenuisthecontentinthedatabase,and

themoduleisaplaceholderforit.Ifyouwanttopositionthe

menu,youmovearounditsplaceholder(themodule)fromthe

left-handtotheright-handcolumnforexample.Ifyouwantto

managethecontentofthemenu(thelinks),thenyougotothe

MenuManager.

TheappearanceofamenuismanagedthroughtheModule

Manager,forexample,whetheralinkgetsanunderlinewhen

youhover,whatcolorthelinkis,andwhetheritlookslikea



button.Allofthesecharacteristicswouldbedefinedinthe

template'sCascadingStyleSheets(CSS)file(moreonthatin

Chapter9,"CreatingaPureCSSTemplate")andarecontrolled

intheModuleManagerbyusingamodulesuffix(alsoexplained

furtherinChapter11,"CreatingaRestaurantSitewith

Joomla").

Figure5.2showsoneofthedefaultmenusinstalled,the

mainmenu.ShownisthemenuintheMenuManager,its

correspondingmoduleintheModuleManager,andhowitis

presentedinthefrontend.

Figure5.2.Interrelationshipbetweenmenusand

modules

[Viewfullsizeimage]



Thebasicbuildingblocksofthesemenusarethemenuitems.

Eachmenuitemcorrespondstoasinglelinkinthefrontend.

Nextwelookattheimportanceofthesemenuitemsandwhat

theydo.

TheLeastYouNeedtoKnow

Thebackendpartofamenu,wherethe



linksgoandwhattheydo,iscontrolledby

theMenuManager.Thefrontendpartofa

menu,whereitis,andwhatitlookslike,is

controlledbyamenu'smodule.



WhatDoMenuItemsDo?

Answer:Alot!

InaJoomlasite,allpagesaregenerateddynamically.Joomla

usesinformationfromwhateverlinkthesitevisitorjustclicked

todecidewhatthewebpagewillcontainandlooklikewhenhe

getsthere.

Youcanthinkofamenulinkashavingthreeparts:

Wherethelinkgoes

WhattheJoomlapagelookslikeafterfollowingthelink

Howthemenulink'sappearanceiscontrolled

Thelinksonthemenuarecontrolledbythemenuiteminthat

menu(heremainmenu)intheMenuManager.Thisdetermines

whatpagestheygotoandtheappearanceofthosepages.This

isthe"where"andthe"what."

Inthisexample,themenu'sappearance(leftcolumn,brown

background,andsoon)iscontrolledbysettingsinthe

mainmenumodule.Thisisthe"how."

Tip

Youcanactuallyhavemorethanone

moduleforamenu.Forexample,youcould

haveamenuappearintheleftcolumnon

thehomepageandintherightcolumnon

otherpagesinthesite.



WesawinChapter4,"ContentIsKing:OrganizingYour

Content"menusandlinkshavesomeimportantcharacteristics:

Menuscontrolthesite.Pagesaredynamicandsodon't



existuntillinkedto.

Menus/linksandcontentarecompletelyindependentof

eachotherinthedatabase;contentmustbecreatedand

thenlinkedto.

Menulinkscanbecreatedasyouarecreatingthecontent

afteritissaved.

Menulinkscanlinktocontentorcomponents.

Menulinksdeterminetheappearanceofthepagelinkedto.

Let'slookinmoredetailatthethreepartsofamenuitem:the

what,where,andhow.Todothislet'screateamenuitem.



CreatingaMenuItem

TheMenuManagercontainsallthemenusonasite.Eachmenu

controlswherelinksgotoandwhatthepagelookslikewhen

yougettherewithinaspecificmodule.

Tobetterunderstandthewhereandthewhat,let'screatea

menuitem(alink)withinamenu.Itdoesn'tmatterwhich

menuatthispoint;youcanpickanytotrythisout.

Whenyoucreateamenuitem,aswesawinChapter4,youget

ascreenwhereyouarepresentedwithatree-likestructure.

Youclicktheoptiontodrilldowntofurtherchoices.Thetop

levelofthetreeisshowninFigure5.3.

Figure5.3.Menulinkoptions

[Viewfullsizeimage]



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Chapter 5. Creating Menus and Navigation

Tải bản đầy đủ ngay(0 tr)

×