Hook for custom_template