Profile image in navigation of Open edX
Before:
So you want to add profile image in navigation with Cypress installation? here’s the simple step.
Go to /edx/app/edxapp/edx-platform/lms/templates/
Open navigation.html
using vim in terminal
Add code below in your header.
1 | from openedx.core.djangoapps.user_api.accounts.image_helpers import get_profile_image_urls_for_user |
The code will look like this
1 | from microsite_configuration import microsite |
Find the <ol class="user">
section and add code below after <li class="primary">
1 | <% |
If you want to enable link in profile image that will direct to learners profile page insert this code
1 | <a style="padding:0px;" href="${reverse('learner_profile', kwargs={'username': user.username})}"></a> |
<%
username = user.username
profile_image_url = get_profile_image_urls_for_user(user)[‘medium’]
%>`
Result:
Done.