Change link on logo in header?


(Del Boy Trotter) #1

How can I change the link on the header logo? I want that to go to our main site so it’s consistent with our main site?

The site in question is http://sonatribe.com and our discourse is at http://discourse.sonatribe.com


(Michael Downey) #2

Are you sure that’s a good idea? Our data shows that many to most people use that link to navigate around the site. We put a header above to link to our other web properties.


(Del Boy Trotter) #3

our site has the same header as discourse to make it feel like one site so it would make sense for us


(Del Boy Trotter) #4

I’m guessing it’s not possible out of the box :confused:


(Marcin Rataj) #5

I think you could try to write some JavaScript that overrides onclick event on the div.d-header div.title img via /admin/customize/css_html


(Jeff Atwood) #6

This is not a good idea. Add a secondary header above the Discourse one with primary nav to get back to your main site, etc. You can do this in Admin, Customize, CSS/HTML and there is an example of it in the READ ME FIRST: Admin Quick Start Guide topic.

Like so: http://discourse.stonehearth.net/

As you scroll down, the topmost nav disappears, leaving just the Discourse nav.


(Del Boy Trotter) #7

with all due respect we assessed what discourse had done with ember and the general design of the forum and decided that it would be a better idea to integrate better with discourse than to shoehorn the other way.

i’ve spent a lifetime of sharepoint “integration” in so far as you do what you can to make your code walk and talk like the barrell of crap you’re trying to integrate with while veering as far as physically possible from it - this time i felt it was apt to nudge up as much as we could.

we’ve made a decision to deeply integrate with discourse for the right reasons. I don’t think (with all due respect) that this is not a good idea.

time is not our commodity atm - code is written during commuter hour with elbows in my face and a 3" desk space haggled from other blood thirsty commuters on the gatwick express - so deeper integration is on the cards but i would prefer to have discourse feel like a part of our site than a bolt on.


(Jeff Atwood) #8

OK, then maybe you want to do something like Bitnami did:

Make a nav on the right.


(Del Boy Trotter) #9

but that’s still different to http://sonatribe.com/


(Manthan Mallikarjun) #10

It looks like you were able to come up with a solution. Would you be able to share the code you used?

Thanks.


(Erlend Sogge Heggen) #11

Indeed, that’s a very interesting integration you have going on there. Would love to learn more about it.


(Del Boy Trotter) #12

Let me know what you’d like to know! :slight_smile:


(Erlend Sogge Heggen) #13

Well you mentioned a “deep integration with Discourse”, I’d like to know more about what that entails. Are you just talking about logins or is there more to it? I had a look around your site checking to see if Discourse was being used as anything other than a standard forum but didn’t find anything.


(Jim Hinks) #14

Completely agree. We use discourse as a forum for https://beta.macguffin.io, and so we customised the header to ape the look and feel of the header on the MacGuffin site (so users don’t feel they’re being siloed off, or taken away, when using the forum). The 2 most common bits of feedback from users on this are:

  1. How come I have to create a new user account to post on the forum (i.e. why can’t they use their existing MacGuffin log-in)? and
  2. how come the home button (which we set as the MacGuffin logo) doesn’t link back to the macguffin site?
    It may well be that Discourse don’t recommend doing this (linking logo to external site) but it’s daft not to pay attention to very clear UX feedback, so the function to easily set link on logo in header would be a welcome addition.

(Del Boy Trotter) #15

We have sso but point 2 is a headache for us


(Jeff Atwood) #16
  1. You should use SSO which is supported

  2. We recommend a secondary header on top which has the nav of the parent site and logo. Scrolling up (or being at top) shows this top header. For example https://talk.turtlerockstudios.com – this is just basic HTML and CSS placed in a Admin, Customize, HTML


(Jim Hinks) #17

Hi Jeff, and thanks for your reply.

I get that you recommend a secondary header, but that’s not an ideal solution everyone. It would be wonderful if there was an easy way to just link the primary logo back to the homepage of the website users are visiting from.

Thanks!


(Mittineague) #18

I haven’t looked into it enough to know if it is an “easy way”, but if you go to the SitePoint forum you can see the forum logo (which goes to forum “home”) and the “Articles” and “Books & Courses” links that go to the “main” SitePoint site.

AFAIK the code is at GitHub if that is any help.


(Kane York) #19

Yep, you should definitely change your logo for the forums. Heck, that alone could stop the complaints!


(Ngô Minh Tuấn) #20

I have requirement from one client to link the logo back to main site. (After a very long discussion, they win)

I accidentally find out (by view source) that https://community.imgur.com/ has done the trick with

<script>
Discourse._registerPluginCode('0.4', function (api) {
  api.changeWidgetSetting('home-logo', 'href', 'http://mainsite.com');
});
</script>

I added this in admin > customize > </head>

If you follow this path, make sure you have a custom link which return user to forum home page. They will need that link in topic page. You may check other discourse pages so users don’t get stuck.

I haven’t found a public page for this api so this trick can be broken with future releases.


update:
More official guide on Js Plugin : Using the PluginAPI in Site Customizations