What are the benefits of using If-Statements in templates?

Using If-Statements in templates allows for conditional logic to be applied to the content displayed on a webpage. This can be useful for showing different content based on certain conditions, such as user roles or preferences. By incorporating If-Statements, templates become more dynamic and customizable, providing a more personalized experience for users.

<?php
if ($user_role === 'admin') {
    echo 'Welcome, Admin!';
} else {
    echo 'Welcome, User!';
}
?>