How to show logged in user's name in the website

@Theo use the code below:

<script>
window.addEventListener('block-loaded-blockname1', () => {
	console.log('Block loaded');
    if(window.logged_in_user) {
        const name = window.logged_in_user.softr_user_full_name;
        $("span:contains('{LOGGED_IN_USER:NAME}')").removeClass('student-name');
        $("span:contains('{LOGGED_IN_USER:NAME}')").html(name);
    }
});
</script>

blockname1 - needs to be your block’s name as shown in the studio settings see the pic below.

1 Like