(+ New topic) button on all pages

Use this code, changing the color obviously.

#new-create-topic {
    background-color: red;
}
3 Likes

Hm, how about showing the new topic button for everyone and make it act like the default Reply-to-topic button, i.e. as the user to login/sign up if they’re not logged in?

In fact, this might be something to consider for the default new topic button too, but I guess this feature would be most effective in this theme component…

4 Likes

Inviting every random visitor to create a new topic… will end in tears :sob:

Nothing kills a site quicker than a page full of low-value or gibberish topics.

6 Likes

Well, they can’t create that topic unless they sign up. And encouraging people to sign up is obviously a good thing (and is being done by default via the sign-up button and the reply-to-topic button). So I don’t really see why the new topic button should cause any problems.

5 Likes

Is it possible to hide the button on mobile but show the floating button?

To hide the button on mobile add

.header-buttons #new-create-topic {
    display:none;
}

in your mobile > CSS tab

The floating button you are referring is the one used on the Material Design Stock Theme component? If so you need to copy and paste the part of CSS relative to the floating button (New Topic Fab) from https://github.com/discourse/material-design-stock-theme/blob/master/desktop/desktop.scss to your mobile > CSS tab (deleting the lines that start with @include [...]).

However your requests are going off topic, it’s better if you open another topic.

3 Likes

Thanks, sorry for the offtopicing :slight_smile:

1 Like

Hey, I noticed i believe a padding problem with the topic button on mobile (or when the window is shrinked). This is experienced on Android and iOS, on Chrome and Safari.


EDIT: I believe this is caused because that extra padding is space reserved for text to go alongside the plus icon. The problem is that reserved padding doesn’t go away when you choose to not have any text.

5 Likes

I had the same problem, for now I added this to my mobile css

#new-create-topic {
	padding-right: 5px;
}
6 Likes

Hello, can we build theme-component Category and tag Menu on all Pages :slight_smile: ?
Thank you!

BUG .
Try adding a post were you’re in an existing post
You will not be able to navigate between available sections

Only display, we need only that?
Everytime, we search anything, we must comeback homepage to search category and tag :robot:

This is good, but it has two drawbacks from my point of view.
First is the location of the button in the top bar. We already have other stuff added to the top bar and this makes it a bit crowded.
Second is the fact it appears on every page, even where it is a bit illogical (eg on my profile page, or the groups list).
The primary use case from my point of view is to make it slightly easier for users not to make off-topic replies when viewing a thread. The place I find it is really needed and useful is when viewing a topic/thread and ideally I would like it to appear both at the top (in line with the topic title) and at the bottom next to the main blue Reply button.
A halfway house would be to show it in the current position but only on /t/xxx pages.
Is this possible?

I don’t want to display it on mobile, how do I do it?

I also want to show it to the unregistered user, clicking the button will ask you to login

Remove this line from the theme component:

https://github.com/discourse/discourse-new-topic-button-theme-component/blob/master/common/header.html#L5

Oh. Bummer. I don’t know what “wrong position” means (it seems OK on my test site), but did assume that the button would work, which I see now that it doesn’t. It looks like it’s not as simple as I thought. :frowning_face:

1 Like

Create a new theme component and add this in the Mobile > CSS tab

.mobile-view #new-create-topic {
    display:none
}
4 Likes

good idea - you did it ?

Can someone help me know what CSS to target to get this + New Topic button to look/function exactly as the colorful “Reply” button on my site? (i.e. the standard state, as well as the hover and clicked-on state - active?)

Here’s a visual explanation of what I’d like to do…

change its class to btn-primary ?
(not sure if you can have two btn-primary items on a page)
If you want to have a pure css solution then inspect the styling of the blue primary button (in all its states) and replicate that.