Recent Changes - Search:

Cookbook

PmWiki

pmwiki.org

DictIndex

Summary: Enable page listings using a "dictionary index" format via fmt=dictindex
Version:
Prerequisites:
Status: Working
Maintainer:
Discussion: DictIndex-Talk

Questions answered by this recipe

How can I get page listings in a "dictionary index" format, i.e., segregated by initial letter of the page name?

Answer

The dictindex.phpΔ script will enable page listings using a "dictionary index" format. This format can be used by anything that produces a page listing; i.e., one can do things like:

    (:pagelist group=Cookbook fmt=dictindex:)
    (:searchresults group=Cookbook text=index fmt=dictindex:)

Description

Enable page listings using a "dictionary index" format via fmt=dictindex

Notes

  • The output can be customized by various $FPLDictIndex...Fmt variables -- see the documentation in the script for details.
  • extdictindex.phpΔ is a modified version of this script so that every index letter has an anchor <a name='$IndexLetter'></a> and that $FPLDictIndexStartFmt contains an index A - B - C - ... where every letter links to the appropriate anchor in the index. Should be useful for a large numer of search results... Nils Knappmeier
    • Just modified it to work also with PmWiki 2.0beta39 Klonk
  • titledictindex.phpΔ is a modified version of this script. It contains the additions made in extdictindex.php but lists not the pagenames, but the pagetitles defined in the separate files. If no pagetitle is defined the pagename will be displayed. I personally think this is the most universal variant. Klonk
    • Modified it to deal better with lowercase titles (also fixed up the whitespaces) Norman Rasmussen
    • Modified with some optimizations as suggested by Pm - Klonk
    • Unfortunately it is not Valid XHTML 1.0 Transitional (W3C Markup Validation Service: http://validator.w3.org/). Seven errors occured.
      • you can change to this
         	SDV($FPLDictIndexStartFmt,"<p id='dictindexheader'>\$IndexLinks</p>\n<dl class='fpldictindex'>\n");
        	SDV($FPLDictIndexEndFmt,'</dl>');
        	SDV($FPLDictIndexLFmt,"<dt><a href='#dictindexheader' id='\$IndexLetterID'>&#9650;</a> \$IndexLetter</dt>\n");
        	SDV($FPLDictIndexIFmt,"<dd><a href='\$PageUrl' title='\$Group : \$Title'>\$Title</a></dd>\n"); 
        	SDV($FPLDictIndexHeaderLink,"\n".'<a href="#$IndexLetterID">$IndexLetter</a>'); 
        - She
    • If you have problems with the above version of titledictindex.phpΔ not displaying the index letters in version 2.2.0-beta44 of the wiki (sorry, not verified for other versions) try replacing line 40 with "$pletter = substr($item['=title'],0,1);" (without the quotes). Daniel Rosendorf - Thanks, included this change - Klonk
  • toggledictindex.phpΔ is modified from titledictindex.php and displays the list by pagetitles but initially hidden, and each section gets toggled in and out of view by clicking on the letter in the list's header. This script uses elements from togglelink.php, but does not need it to run. ~HansB August 01, 2006, at 10:31 AM

Release Notes

If the recipe has multiple releases, then release notes can be placed here. Note that it's often easier for people to work with "release dates" instead of "version numbers".

See Also

Contributors

Comments

See discussion at DictIndex-Talk

Edit - History - Print - Recent Changes - Search
Page last modified on September 02, 2012, at 11:19 PM