Hard-coding images into block templates
Permalink 1 user found helpfulecho str_replace($_SERVER['DOCUMENT_ROOT'], '', $this->getBlockPath()) . '/templates/templatename/images/image.png'
Am I missing a neater way to do this or is this the best solution?
Joe
I've also tried dynamically outputting the current template name so that doesn't need to be hardcoded in the path, but could never get it to work so as far as I know the above code is the simplest/best way to go.