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

Ben Stallings ben at interdependentweb.com
Wed Aug 8 16:01:31 CDT 2007


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.

If there's a function somewhere that determines whether a specific 
attachment exists -- which there may be, since links are treated 
differently on that basis -- then I could write a conditional to test 
that function, but the only one I can find is AttachExist(), which only 
tests whether the current page has attachments or not.

...or would it be easier to change the upload link format on these pages 
(but not on other pages) so that upload links are hidden?  Ideas 
welcome.  Thanks!  --Ben



More information about the pmwiki-users mailing list