[pmwiki-users] not listing empty pages
Peter Bowers
pbowers at pobox.com
Tue May 10 06:33:42 CDT 2011
On Tue, May 10, 2011 at 6:46 AM, Oguz Altun <oguz at ce.yildiz.edu.tr> wrote:
> I build my sidebar from (:pagelist:) searches. Is it possible to not see
> empty (as in all the content is deleted in the edit window, but the history
> is there) pages? I would prefer that to actually deleting pages.
You could put together a custom conditional ("notempty"?) that
accepted a pagename as an argument. It would simply read in the page
and then just return !preg_match("/^\s*$/s", $page['text'])...
Then in your pagelist you would use (:pagelist ... if="notempty
{=$FullName}" ... :).
See http://www.pmwiki.org/wiki/Cookbook/ConditionalMarkupSamples#intext
for an example to follow.
Or another approach would be to create a PV {$EmptyPage} which would
return 1 or 0 depending on whether it was empty or not.
-Peter
More information about the pmwiki-users
mailing list