28.4.4 Using macros to process lists
Suppose you want to generate a different set of sidebar navigation links for each major section of a Web site, where each section is in a single FrameMaker file that Mif2Go splits into named pages (see §18 Splitting and extracting files). For each page, the sidebar item that names that page should not be a link, because a live link to the current page confuses people.
You need a slightly different list of sidebar items on every HTML page, to avoid a same-page link. But the logic is always the same, as are the names of files and the titles to be displayed. What is needed is a macro that takes into account which item should not be linked.
Your configuration file could include a pair of lists, one with file names and the other with matching sidebar titles, like this:
4 = What Users Say About Widgets
You could process the two lists with this macro:
<$_while ($$val <= $$maxval)>\
<$_if ($$_currbase is $$FM_File[$$val])>\
<p class="SidebarTxt"><$$SideTitle[$$val]></p>\
<p class="SidebarTxt"><a class="SidebarLnk"\
href="<$$FM_File[$$val]>.htm"><$$SideTitle[$$val]></a></p>\
> 28 Working with macros > 28.4 Using multiple-value list variables > 28.4.4 Using macros to process lists