Here's how to change the Discourse profile to your own website's profile pages


#1

I wanted to replace the Discourse profile pages with my own (hosted on another domain, non-Discourse):

Profile - levelsio - Digital Nomad Forum (Discourse)
->
https://nomadlist.com/u/levelsio (self)

I used these handlebars, first I couldn’t get the clicks to work, the URL changed but clicking still pointed it to Discourse’s profiles. That’s because you have to remove {{action “showUser”}}, it overrides the href="" (duh)

    <script type='text/x-handlebars' data-template-name='post/components/small-action'>
<script type='text/x-handlebars' data-template-name='post/components/small-action'>
	<div class='topic-avatar'>{{fa-icon icon}}</div>
	<div class='small-action-desc'>
	  {{#if post}}
	    {{#if post.can_delete}}
	      <button {{action "delete"}} title={{i18n "post.controls.delete"}}>{{fa-icon "times"}}</button>
	    {{/if}}
	    {{#if post.can_edit}}
	      <button {{action "edit"}} title={{i18n "post.controls.edit"}}>{{fa-icon "pencil"}}</button>
	    {{/if}}
	    <a href="https://nomadlist.com/u/{{post.username}}" data-user-card={{post.username}}>
	      {{avatar post imageSize="small"}}
	    </a>
	  {{/if}}
	  <p>{{description}}</p>
	  {{#if post.cooked}}
	    <div class='custom-message'>{{{post.cooked}}}</div>
	  {{/if}}
	</div>
</script>
<script type='text/x-handlebars' data-template-name='user-card'>
	{{#if controller.visible}}
	<div class="card-content">

	  <a href="https://nomadlist.com/u/{{username}}">{{bound-avatar avatar "huge"}}</a>

	  <div class="names">
	    <span>
	      <h1 class="{{staff}} {{new_user}}">
	        <a href="https://nomadlist.com/u/{{username}}">{{username}} {{user-status user currentUser=currentUser}}</a>
	      </h1>

	      {{#if user.name}}
	        <h2>{{user.name}}</h2>
	      {{/if}}

	      {{#if user.title}}
	        <h2>{{user.title}}</h2>
	      {{/if}}

	      {{plugin-outlet "user-card-post-names"}}
	    </span>
	  </div>

	  <ul class="usercard-controls">
	    {{#if user.can_send_private_message_to_user}}
	      <li><a class='btn btn-primary' {{action "composePrivateMessage" user post}}>{{fa-icon "envelope"}}{{i18n 'user.private_message'}}</a></li>
	    {{/if}}

	    {{#if showFilter}}
	      <li><a class='btn' href {{action "togglePosts" user}}>{{fa-icon "filter"}}{{i18n 'topic.filter_to' username=username post_count=topicPostCount}}</a></li>
	    {{/if}}

	    {{#if hasUserFilters}}
	      <li><a class='btn' href {{action "cancelFilter"}}>{{fa-icon "times"}}{{i18n 'topic.filters.cancel'}}</a></li>
	    {{/if}}

	    {{#if showDelete}}
	      <li><a class='btn btn-danger' href {{action "deleteUser" user}}>{{fa-icon "exclamation-triangle"}}{{i18n 'admin.user.delete'}}</a></li>
	    {{/if}}
	  </ul>

	  {{#if isSuspended}}
	    <div class='suspended'>
	      {{fa-icon "ban"}}
	      <b>{{i18n 'user.suspended_notice' date=user.suspendedTillDate}}</b><br/>
	      <b>{{i18n 'user.suspended_reason'}}</b> {{user.suspend_reason}}
	    </div>
	  {{else}}
	    {{#if user.bio_cooked}}<div class='bio'>{{text-overflow class="overflow" text=user.bio_excerpt}}</div>{{/if}}
	  {{/if}}

	  {{#if user.card_badge}}
	    {{#link-to 'badges.show' user.card_badge class="card-badge" title=user.card_badge.name}}
	      {{icon-or-image user.card_badge.image title=user.card_badge.name}}
	    {{/link-to}}
	  {{/if}}

	  {{#if user}}
	    <div class="metadata">
	      {{#if user.last_posted_at}}
	        <h3><span class='desc'>{{i18n 'last_post'}}</span> {{format-date user.last_posted_at leaveAgo="true"}}</h3>
	      {{/if}}
	      <h3><span class='desc'>{{i18n 'joined'}}</span> {{format-date user.created_at leaveAgo="true"}}</h3>
	      {{plugin-outlet "user-card-metadata"}}
	    </div>
	  {{/if}}

	  {{#if showBadges}}
	    <div class="badge-section">
	      {{#each ub in user.featured_user_badges}}
	        {{user-badge badge=ub.badge}}
	      {{/each}}
	      {{#if showMoreBadges}}
	        {{#link-to 'user.badges' user class="btn more-user-badges"}}
	          {{i18n 'badges.more_badges' count=moreBadgesCount}}
	        {{/link-to}}
	      {{/if}}
	    </div>
	  {{/if}}
	</div>
	{{/if}}
</script>

<script type='text/x-handlebars' data-template-name='post/components/small-action'>
	<div class='topic-avatar'>{{fa-icon icon}}</div>
	<div class='small-action-desc'>
	  {{#if post}}
	    {{#if post.can_delete}}
	      <button {{action "delete"}} title={{i18n "post.controls.delete"}}>{{fa-icon "times"}}</button>
	    {{/if}}
	    {{#if post.can_edit}}
	      <button {{action "edit"}} title={{i18n "post.controls.edit"}}>{{fa-icon "pencil"}}</button>
	    {{/if}}
	    <a href="https://nomadlist.com/{{post.username}}" data-user-card={{post.username}}>
	      {{avatar post imageSize="small"}}
	    </a>
	  {{/if}}
	  <p>{{description}}</p>
	  {{#if post.cooked}}
	    <div class='custom-message'>{{{post.cooked}}}</div>
	  {{/if}}
	</div>
</script>

<script type='text/x-handlebars' data-template-name='user/posts'>
	{{#each p in model.content}}
	  <div {{bind-attr class=":item p.hidden p.deleted p.moderator_action"}}>
	    <div class="clearfix info">
	      <a href="https://nomadlist.com/u/{{unbound p.username}}" class="avatar-link">
	        <div class="avatar-wrapper">
	          {{avatar p imageSize="large" extraClasses="actor" ignoreTitle="true"}}
	        </div>
	      </a>
	      <span class="time">
	        {{format-date p.created_at leaveAgo="true"}}
	      </span>
	      <span class="title">
	        <a href="{{unbound p.url}}">{{unbound p.topic_title}}</a>
	      </span>
	      <span class="category">
	        {{category-link p.category}}
	      </span>
	      {{#if p.deleted}}
	        <span class="delete-info">
	          <i class="fa fa-trash-o"></i> {{avatar p.deleted_by imageSize="tiny" extraClasses="actor" ignoreTitle="true"}} {{format-date p.deleted_at leaveAgo="true"}}
	        </span>
	      {{/if}}
	    </div>
	    <p class="excerpt">
	      {{{p.excerpt}}}
	    </p>
	  </div>
	{{/each}}
</script>

<script type='text/x-handlebars' data-template-name='user/posts'>
	{{#each p in model.content}}
	  <div {{bind-attr class=":item p.hidden p.deleted p.moderator_action"}}>
	    <div class="clearfix info">
	      <a href="https://nomadlist.com/u/{{unbound p.username}}" class="avatar-link">
	        <div class="avatar-wrapper">
	          {{avatar p imageSize="large" extraClasses="actor" ignoreTitle="true"}}
	        </div>
	      </a>
	      <span class="time">
	        {{format-date p.created_at leaveAgo="true"}}
	      </span>
	      <span class="title">
	        <a href="{{unbound p.url}}">{{unbound p.topic_title}}</a>
	      </span>
	      <span class="category">
	        {{category-link p.category}}
	      </span>
	      {{#if p.deleted}}
	        <span class="delete-info">
	          <i class="fa fa-trash-o"></i> {{avatar p.deleted_by imageSize="tiny" extraClasses="actor" ignoreTitle="true"}} {{format-date p.deleted_at leaveAgo="true"}}
	        </span>
	      {{/if}}
	    </div>
	    <p class="excerpt">
	      {{{p.excerpt}}}
	    </p>
	  </div>
	{{/each}}
</script>


<script type='text/x-handlebars' data-template-name='post/poster-avatar.raw'>
<a href="https://nomadlist.com/u/{{post.username}}" classNames="trigger-user-card {{classNames}}" data-user-card="{{post.username}}">{{avatar post imageSize="40"}}</a>
</script>

<script type='text/x-handlebars' data-template-name='list/posters-column.raw'>
<td class='posters'>
{{#each poster in posters}}
<a href="https://nomadlist.com/u/{{poster.user.username}}" data-user-card="{{poster.user.username}}" class="{{poster.extras}}">{{avatar poster avatarTemplatePath="user.avatar_template" usernamePath="user.username" imageSize="40"}}</a>
{{/each}}
</td>
</script>

<script type='text/x-handlebars' data-template-name='list/topic-list-item.raw'>

  {{#if controller.bulkSelectEnabled}}
      <td class='star'>
       <input type="checkbox" class="bulk-select">
     </td>
    {{/if}}


    {{#if controller.showPosters}}
      {{raw "list/posters-column" posters=topic.posters}}
    {{/if}}
    
    {{#if controller.showParticipants}}
      {{raw "list/posters-column" posters=topic.participants}}
    {{/if}}
    
    <td class='main-link clearfix' colspan="{{titleColSpan}}">
      {{raw "topic-status" topic=topic}}
      {{topic-link topic}}
      {{#if controller.showTopicPostBadges}}
        {{raw "topic-post-badges" unread=topic.unread newPosts=topic.displayNewPosts unseen=topic.unseen url=topic.lastUnreadUrl}}
      {{/if}}
      {{plugin-outlet "topic-list-tags"}}
        {{raw "list/topic-excerpt" topic=topic}}
      {{raw "list/action-list" topic=topic postNumbers=topic.liked_post_numbers className="likes" icon="heart"}}
    </td>
    
    {{#unless controller.hideCategory}}
      {{#unless topic.isPinnedUncategorized}}
        {{raw "list/category-column" category=topic.category}}
      {{/unless}}
    {{/unless}}
    
    {{raw "list/activity-column" topic=topic class="num" tagName="td"}}
    {{raw "list/posts-count-column" topic=topic tagName="td"}}
</script>

P.S. I asked this before and it was closed as it was answered with a link to another thread with the same question, however that thread did NOT include an answer either, this one does!


Can't override user-menu.hbs template?
How to redirect to external profile on forum profile?
#4

I’m having trouble getting the same thing to work on mobile (which doesn’t trigger the profile popup). Have you had success with that?