add preview function (include livepreview)
add preview template html