single-item page template
added DIR const
various refactoring