Can't override user-menu.hbs template?


I’m trying to override the Profile link on user-menu.hbs with a script (to redirect to an external profile per the strategy here: Here’s how to change the Discourse profile to your own website’s profile pages) but my overrides don’t seem to be working. Any tips?

<script type='text/x-handlebars' data-template-name='components/user-menu.hbs'>
{{#menu-panel visible=visible}}
  <div class='menu-links-header'>
    <ul class='menu-links-row'>
      <li>{{d-link route='user' model=currentUser class="user-activity-link" icon="user" label="user.profile"}}</li>

      {{#if showDisableAnon}}
      <li>{{d-link action="toggleAnon" label="switch_from_anon"}}</li>
      <li class='glyphs'>
        {{d-link path=bookmarksPath title="user.bookmarks" icon="bookmark"}}
        {{#if siteSettings.enable_private_messages}}
          {{d-link path=messagesPath title="user.private_messages" icon="envelope"}}
        {{#if showEnableAnon}}
          {{d-link action="toggleAnon" title="switch_to_anon" icon="user-secret"}}
        {{d-link path=preferencesPath title="user.preferences" icon="gear"}}

(Luke Chambers) #2

Did you ever end up working this out? We’re wanting to do the same thing and would love to know if/how you achieved it.

(Mittineague) #3

I don’t know how @Joey_Tuan did.

But I shy away from messing with routing behavior like taking over the Profile link.

It would however be very easy to add another link eg. “other profile” to the menu using the plugin-outlet.