improve handling of page_type and template

• make sure the changes are saved and the selected values handled properly
• add focus to edit button instead of accordion tab