Added conditional logic in template

Links to next and/or previous chapter are displayed, if applicable