Thread:Les Thompson/@comment-5428123-20130108084332/@comment-5428123-20130111083455

I've finally did it! I took hours of fiddling with code, but I did it! The template will now automatically detect to see if an image with the exact same name as the page exists. If such an image exists, it will automatically use that. If it doesn't, it will automatically use the placeholder instead.

And just like before, I've given the option of manually entering the image name (so pages using incorrectly named images don't break). However, I should not that the template can only detect PNG and JPG files (we only use those anyway). Plus, the image name has to be an exact match to the page name for it to be properly detected (that was a given anyway).

I've tested it with multiple pages, but feel free to try it out yourself. If you have any more suggestions, let me know!