Include template iff theme enabled

conditionally do template includes to fix lms tests