CMS-3218 Remove buttons when content cannot be rendered.
Refactored duplicate code in Action.