Help - Search - Members - Calendar
Full Version: if directory exists...
Movable Type Community Forum > Additional Resources > Tips and Tricks
prohtex
I need a way to determine if a directory exists (seems this would be useful for files too) using template tags. something like
CODE
<MTIfDirExists dir="/www/mt/customdir"> ... <MTElse> ... </MTIfDirExists>
... any ideas?

(long version...

Basically I am using the plugin with custom directories and I want to be able to display an alternate header if there is no photo dir for a given album.
But- it seems like this would be useful for a lot of things. This is a very easy thing to do in php, but the MT tags are obviously processed before the PHP, so I still get an error from when I try to build w/o the appropriate dir.

)
kadyellebee
Maybe you could adapt your script to use PHP to store the alternatives within MT and then test for the directory afterwards. I suppose it depends on how complex your MT code is that you are outputting is.

Kristine
prohtex
sorry - i forot to mention which plugin i am using. it is the mtphotogallery plugin, so i that method won't work...
kadyellebee
Maybe that's something Brandon could code into that plugin... or maybe there's a feature already in it that could help if you ask him. smile.gif

Kristine
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.