[pmwiki-users] Static 'site maps'?

Peter Bowers pbowers at pobox.com
Sun Jan 2 05:43:33 CST 2011


On Sun, Jan 2, 2011 at 5:08 AM, Steve G. <wordz2u at gmail.com> wrote:
> To facilitate using the site, I created 'site maps' - dynamically generated
> wiki pages, which contain a pagelist for each group I want to include. For
> example, on recipes, there is a site map page,
> http://www.words2u.net/recipes/index.php?n=Recipes.Recipes which include a
> line for each group as follows:  (:pagelist group=Breads list=normal
> order=-ctime fmt=#title -Template:)
>
> I tried a list for all groups in the site using  (:pagelist list=normal
> order=-ctime fmt=#title -Template:), but then the list does not break the
> recipes and does not even list the groups, only the page names. So it is
> hard to tell what is a bread and what is a soup, etc. (I may be ignorant of
> the way to create a better list structure, as I am not much of an expert in
> pmwiki, so feel free to advise on the proper usage of pagelist.)

You ought to check out the fmt=X with supplied formats as well as the
custom templates that pagelist makes possible.  These are the true
genius behind pagelists, making them an incredibly powerful tool.

In your case you probably want fmt=#bygroup

(:pagelist list=normal order=-ctime fmt=#title -Template fmt=#bygroup:)

Actually #bygroup is identical to the *default* format, but I'm
assuming from your above paragraph that something in your config.php
or Site.PageListTemplates is changing it to something else.  If you
need greater visual differentiation from one group to another then you
might want to try a custom pagelist such as this:

===(snip)===
(:if false:)
[[#bygroup2]]
(:template first {=$Group}:)

----
[++'''{=$Group}'''++]
----
(:template each:)
* [[{=$Group}/{=$Name}]]
[[#bygroup2end]]
(:ifend:)
===(snip)===

Simply put that on the same page as your pagelist (or in
Site.LocalTemplates) and then specify (:pagelist ... fmt=#bygroup2:).

> NOW to the question:
>
> The main site has a large number of pages, and the site map,
> http://www.words2u.net/pmwiki/?n=Home.SiteMap, takes a long time to generate
> dynamically. It is not a traffic issue, as the problem exists also in the
> local network. Rather, it is a processing issue. I get much faster response
> with pages that have images much larger in size.
>
> I would like to be able to create a static page with the same content, which
> will be updated daily, or whenever a new page is created. Is there a way in
> pmwiki to have such a page? Maybe a script that will run the pagelist with
> the same parameters as the current page, and write to an existing page, or
> create a new one.

While there are possibilities for creating static pages with pagelist
content [1] this is certainly not the recommended way to pursue it.
Pagelist in and of itself has very strong caching capabilities which
should take care of all your optimization needs.  Check out
http://www.pmwiki.org/wiki/PmWiki/PagelistVariables#PageListCacheDir
and http://www.mail-archive.com/pmwiki-users@pmichaud.com/msg19081.html
for more information on how to implement this.

-Peter

[1] http://www.mail-archive.com/pmwiki-users@pmichaud.com/msg19406.html
shows one way -- again, this is not recommended.



More information about the pmwiki-users mailing list