[pmwiki-users] pagelists link= with pages generated externally

Patrick R. Michaud pmichaud at pobox.com
Wed May 9 16:41:18 CDT 2007


On Wed, May 09, 2007 at 11:23:59PM +0200, Christophe David wrote:
>    As suggested in http://www.pmwiki.org/wiki/PmWiki/PageFileFormat , I
>    generate PmWiki pages from external applications, in order to produce
>    reports and other things while taking advantage of all the PmWki features.
> 
>    Everything works fine, except that I cannot get categories to work
>    properly :
>    ...
>    When I read the page Reports.ReportNumber1 and then click on the link to
>    CategoryName1, PmWiki loads the page and displays the
>    ReportsCategories.GroupFooter,
>    but the pagelist remains empty.
> 
>    If I then do some manual editing in the page, the pagelist works OK and
>    shows the links to the page.
> 
>    I guess PmWiki must do some internal "indexing" when saving the pages,
>    that is uses later on to retrieve the links to the pages efficiently.
> 
>    Is this correct ?

This is correct.  The problem is likely that the page is missing
the targets= attribute; PmWiki uses this to determine which pages
link to the corresponding Category page.

>    If yes, can an action be used or a function be called to "re-index" so
>    that the pagelists using link= work OK with pages generated externally ?

At present there's not a re-index function other than editing the
page... but I might be able to come up with one.

It might turn out to be as simple as (untested!)

    if ($action == 'reindex') 
      { $action = 'edit'; $_POST = array('post'=>'1'); }

Executing ?action=reindex on any page will then cause PmWiki to
regenerate the page, as if someone had done an edit+save sequence.

Again, this is untested, so you might want to try it on a page
you can safely lose if something goes wrong.  :-)

Pm



More information about the pmwiki-users mailing list