filsa.net: Frontier / Scripts / Navigation Macros / Yahoo Paths
This is part of Phil's Script Archive

UPDATED: Ready for Frontier 5!

Yahoo Paths

Easy navigation for your site. This macro creates Yahoo style paths based on your folder structure.


This fat web page contains the yahooPaths script object.

Use the 'Get Page Data' command from the Scripts menu to copy yahooPaths into your object database.

Also available: info about fat pages and the Terms under which you can use this script.

Take a look at the link bar at the top of this page. It was generated by the yahooPaths() macro. Nifty, isn't it? It reflects the organization of this site.

If your organization of your folders(sub-tables) makes sense, this macro lets your users take advantage of that quickly and easily.

It creates a line of links that reflects the position of the current page in your root, providing links to the default file in each subtable it's nested in, all the way out to the root table of the site.

Using Yahoo Paths

Here's a list of the parameters for this script. They are all optional:

yahooPaths (prefix="", suffix="", divider = " | ", useFolderNames=true, adrTopTable=@root, caseConvert=true, usePageTitle=true)

prefix and suffix let you insert HTML code before and after every element in the path.

divider lets you choose what to put between elements in the path.

{yahooPaths ("<i>","</i>")}

generates

Frontier | Scripts | Navigation Macros | Yahoo Paths

useFolderNames: If true, it uses the folder names (sub-table names) to make up the path elements. It also capitalizes the first letter of the folder name and breaks apart inner case names. It defaults to true, you can see the results above.

If it's false, it uses the title of the default page to build the path. So this:

{yahooPaths ("<i>","</i>", useFolderNames:false)}

generates

Phil's Frontier Scripting Site | Phil's Script Archive | Navigation Macros | Yahoo Paths

adrTopTable: lets you set the top table for yahooPaths. Sometime you want to use yahooPaths for just a portion of your site, not all the way up to the top. In that instance, set adrTopTable to the top table level that you want to include. This is optional, and should be an address. yahooPaths automatically stops (of course) at the top level of your site.

YahooPaths automagically breaks apart foldernames into separate words if they have innerCase. The caseConvert param turns this on/off. Defaults to true.

There was a bug where the last item of the yahooPath clickTrail was always was the page title, no matter what useFolderNames was set to. I actually prefer this, so in fixing the bug I made it an optional parameter. usePageTitle defaults to true, turn it off if you want to use the file name instead.

Notes

Tue, Jan 19, 1999 at 3:35:26 PM

  1. Added caseConvert param
    • innerCaseName processing is now optional.
  2. Added usePageTitle
    • this is a bug fix
    • regardless of whether useCaseNames was true, it always used the page title

Wed, Apr 22, 1998 at 5:03 AM

  • Added adrTopTable preference.
  • Fixed a bug that only occurred when the only page with a title was the last item in a table.
  • Completely rewrote the macro. I wrote this in a big rush last September as sample code, and finally got around to cleaning it up. The cleanup was inspired in part by Heath Tanner.

View the Source: user.html.macros.yahooPaths


© copyright 1997-98 by Philip Suh. Comments are appreciated.
This page last updated on 1/20/99; 10:39:46 AM.
<http://www.filsa.net/frontier/scripts/NavigationMacros/yahooPaths.html>
filsa.net: Frontier / Scripts / Navigation Macros / Yahoo Paths