Only render the previous and next links if there are events (see #5426)