Create dynamic page templates on the fly with WordPress
First, enable the plugin from Settings -> DX Template Options
Then crete your dynamic templates in the DX Templates menu
Finally, assign a template to a post/page from the dropdown in the metabox on the top right of your Add/Edit Post screen.