CODE

Display username and secure zone access to a logged in user

Display member details, such as username and subscribed secure zones, on any page.

v1.0.0
  1. This block of code is useful for sites where you wish to display the username and assigned secure zones to a site member. For example, once a user has logged in, this information can be useful on their member profile page or on the welcome page once they are logged in. The <H2> heading also places their first name in the tag.

    {% comment %}<!-- Treehouse CODE v1.0.0 -->{% endcomment %}
    <h2>Welcome {{request.currentmember.firstname}}</h2>
    <h3>Logging in and zone access on our site</h3>
    <p>Your user name is <strong>{{request.currentmember.email}}</strong> and you are subscribed to the following secure zones:</p>
    <ul>
    {% for zone in request.currentmember.securezones %}
        <li><strong>{{zone.name}}</strong></li>
    {% endfor %}
    </ul>

Comments or questions? Head over to the Treepl CMS forum to discuss with the community.