Breadcrumbs - movabletype/Documentation GitHub Wiki
On an MT4+ powered site that has pages and folders, the following code delivers a completely effective breadcrumb navigation trail:
<a href="<MTBlogURL>">Home</a> » <MTParentFolders> <a href="<MTBlogURL><MTFolderPath>"><MTFolderLabel></a> » </mtparentfolders> <strong><MTPageTitle></strong>
The MT4 documentation on the tag has an error in the code:
<MTTopLevelFolders> <MTSubFolderIsFirst><ul></mtsubfolderisfirst> <MTIfNonZero tag="MTFolderCount"> <li><a href="<$MTFolderArchiveLink$>" title="<$MTFolderDescription$>"><MTFolderLabel></a> <MTElse> <li><MTFolderLabel> </mtelse> </mtifnonzero> <mt:SubFolderRecurse> </li> <MTSubFolderIsLast></ul></mtsubfolderislast> </mttoplevelfolders>
There's simply no such thing as
<MTSubFolderIsFirst>, <MTSubFolderIsLast> and <MTFolderArchiveLink>(duh?) tags.
This will list all pages (contained in a folder) and folders across the weblog.
<ul> <MTTopLevelFolders> <li><a href="<MTFolderPath>"><MTFolderLabel></a></li> <ul> <MTPages> <li><a href="<MTPagePermalink>"><MTPageTitle></a></li> </mtpages> </ul> <ul><MTSubFolderRecurse></ul> </mttoplevelfolders> </ul>
This lists only the folders and sub-folders, but no pages.
<ul> <MTTopLevelFolders> <li><a href="<MTFolderPath>"><MTFolderLabel></a></li> <ul> </ul> <ul><MTSubFolderRecurse></ul> </mttoplevelfolders> </ul>
This lists only the top level folders, no sub-folders or pages.
<ul> <MTToplevelFolders> <li><a href="<MTBlogURL><MTFolderBasename>/index.php"><MTFolderLabel></a></li> </mttoplevelfolders> </ul>
Conceivably useful in a sidebar on every page, this lists all the pages and sub-folders in the present page folder. Note that it also lists the current page.
<ul> <MTPageFolder> <MTPages sort_by="date"> <li><a href="./<MTPageBasename>.php" id="<MTPageBasename>"><MTPageTitle></a></li> </mtpages> <MTSubFolders> <li><a href="<MTBlogURL><MTFolderPath>/index.php"><MTFolderLabel> »</a> <ul> <MTPages><li><a href="<MTPagePermalink>"><MTPageTitle></a></li></mtpages> <MTSubFolderRecurse> </ul> </li> </mtsubfolders> </mtpagefolder> </ul>
This works very well. It eliminates the current page from the listing, and lists all the other pages, sub-folders and sub-folder pages in the present page folder.
<ul> <mt:setvarblock name="curpage"><mt:pageid></mt:setvarblock> <MTPageFolder> <MTPages sort_by="title" sort_order="ascend"> <mt:setvarblock name="listpage"><mt:pageid /></mt:setvarblock> <mt:unless name="listpage" eq="$curpage"> <li><a href="./<MTPageBasename>.php" id="<MTPageBasename>"><MTPageTitle></a></li> </mt:unless> </mtpages> <MTSubFolders> <li><a href="<MTBlogURL><MTFolderPath>/index.php"><MTFolderLabel> »</a> <ul> <MTPages><li><a href="<MTPagePermalink>"><MTPageTitle></a></li></mtpages> <MTSubFolderRecurse> </ul> </li> </mtsubfolders> </mtpagefolder> </ul>
Almost all of this is from caribou's post at the sixapart forums.
--Gautam Patel 22:03, 15 December 2007 (PST)