How to set a condition that will show/attach appropriate link to file?