sample code to have post previews.