Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for real user name #652

Conversation

simontaurus
Copy link
Contributor

add a config option to display the user's real name in the user menu. Useful in combination with Extension:Realnames

not really happy with the string replace approach - not sure if there's an option to adapt the generation of $userPageData['html-items'] directly

add a config option to display the user's real name in the user menu
@alistair3149
Copy link
Member

alistair3149 commented Jun 4, 2023

Probably doesn't need a config, we can check whether real name exists. If one exists, then display both.
The string replace method is fine since it has the least headache. The real name item would link to the same user page anyways. I would suggest doing the same thing, but instead replace the username with both real name and user name wrapped in divs, like this:

<li id="pt-userpage-2" class="mw-list-item">
    <a href="/User:DefinitelyNotJohn" title="Your user page [alt-shift-.]" accesskey=".">
        <div class="pt-userpage-realname">John Doe</div>
        <div class="pt-userpage-username">DefinitelyNotJohn</div>
    </a>
</li>

And with some CSS, it should turn into this:
image

My MW setup is broken at the moment so I can't test PHP changes, but I can help with the CSS part if needed.

@simontaurus
Copy link
Contributor Author

thanks for solving this and sorry I didn't manage to update the pull request according to your comments in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants