I did what you said above, works well. However, rendering is an issue:
Is it possible to render pages as they are if you go to them? Things like task attributes as shown here don't render with the lua function based solution, but render as the original page in the Virtual page based solution.