adjust pages template style and sql