created function for rendering into base template