[pmwiki-users] how to hide upload links for nonexistent attachments

Patrick R. Michaud pmichaud at pobox.com
Wed Aug 8 20:12:54 CDT 2007


On Wed, Aug 08, 2007 at 04:01:31PM -0500, Ben Stallings wrote:
> Hello again.  I'm trying to do something that ought to be simple, but 
> I'm not sure how to go about it...
> 
> I'm writing a pagelist template and want to display an image whose name 
> matches the name of the listed page if that image exists, and not 
> display anything at all if the image doesn't exist.  But 
> Attach:{=$Name}.jpg and (:thumb {=$Name}.jpg:) both display an upload 
> link if the file doesn't exist.

Perhaps hide the link using css?

    .fpltemplate .createlinktext { display:none; }
    .fpltemplate .createlink { display:none; }

This suppresses the display of all "create link" elements within
the output of a pagelist template.

We could also see about adding a condition to test for the
existence of an attachment.

Pm



More information about the pmwiki-users mailing list