I'm hoping that nXhtml mode and its support for Multiple Major Modes might do the trick here http://ourcomments.org/Emacs/nXhtml/doc/nxhtml.html
http://ourcomments.org/Emacs/nXhtml/doc/nxhtml.html#php
What is wanted for Aspen simplates is to use Python for the first two pages, and use the file extension to determine the mode/highlighting for the third page. The first two pages are optional.