Change the first view for newly invited users?


(Philip Battin) #1

Is it possible to change what newly invited users see for the first time they visit the site?
Currently they see top posts of all time - but in our case, we just launched our site as a closed beta and all the top posts are really bad posts (because they are just old and received a lot of hits while we built the site)

Is it possible to change the default landing page for newly invited users to ‘recent’ or similar?


(Jeff Atwood) #2

No way to do that at the current time – I suggest cleaning up the old topics in advance. If it’s bad content you are not comfortable putting in front of people, why keep it on your site?


(Philip Battin) #3

It is alright content, but it is showing really old topics we created a long time ago.
We just want new users to see recent topics, really.


(Jeff Atwood) #4

Hmm, I can see an argument for default top for new users to be “this year” instead of “all time” @zogstrip. That’d at least rule out ancient topics.

But we do have top page default timeframe in site settings… have you tried changing that?


(Philip Battin) #5

yeah changed it to weekly - which would also work for us – but nothing changed. Still showing top posts of all time.


(Jeff Atwood) #6

That may be a bug then for @zogstrip to look at.


(Philip Battin) #7

yes, top page default timeframe does not change anything on our site. not even the actual default timeframe when clicking top. Would be great to have a fix for that!


(Philip Battin) #8

Found a setting for it!

It did the trick for us!

However, our top default timeframe is still broken :slight_smile:


(Jeff Atwood) #9

Yeah this should work, and the default should be “This Year” out of the box @zogstrip. That would prevent long-dead topics from being highlighted…


(cpradio) #10

That setting works for me…

top page default timeframe, changed it to weekly, visited the /top page, it shows weekly. Switched it to yearly, it shows yearly.

Now, whether the redirecting a user to the top page utilizes that setting, is a completely different question.

The intent I believe for that setting was when Top was set to the homepage, you could make it showcase a certain timeframe versus all, to make the homepage look more fresh and interesting.

More details on that setting at


(Philip Battin) #11

Weird, changing the default top timeframe does nothing on our site.

Screenshots below:


Changed the setting

No effect at /top
(Danish site, år means year)


(cpradio) #12

How are you visiting that page? Are you logged in or an anonymous user? Are you returning to the site after being away for a while? What is the value of topics_per_period_in_top_page in your Admin > Settings?

As that site setting only affects the default view, there is logic in Discourse that may switch it to something else if you weren’t there for several days

That logic didn’t change. Wonder if it should have… as maybe the score is finding a value acceptable via :yearly on your setup.


(Philip Battin) #13

Topics per period

I am visiting the site from two different logged in users: an admin user and a regular member user. Same behavior. I just created the regular user as a test and i am still presented with a yearly overview under top as default.

Not sure what you mean? Is that the intended behavior? In that case, what does the setting then do?


(cpradio) #14

Well right now it is purely only in affect if the yearly period doesn’t have enough entries to warrant its display (based on the code). It seems yours does.

That code may need to be tweaked to behave differently, if the setting is to imply something else. Not sure what that should look like though.

One possible option would be to force the default timeframe to be the first entry in periods[], so yes, it might get checked twice, but if the default view returns an applicable score and an applicable number of topics, it will get used.


(cpradio) #15

Here is what I was thinking and the tests all seem to pass
https://github.com/discourse/discourse/compare/master...cpradio:default_top_timeframe

@zogstrip, do you see this being accepted via PR?

In short, it ensures the default top page setting is returned by best_periods_for, it doesn’t mean it will get used, as it might not have a score > 0 or enough entries (and thus a different period may get returned), but it will at least give it a chance to be used.


(Régis Hanol) #16

:100: :100: :heart_eyes:


(Philip Battin) #17

What about a simple setting like this

Top page default timeframe:
When a user clicks top - what is he/she always presented with?

Newly invited users landing page:
What view on the front page is newly invited users presented with?


(Philip Battin) #18

Update: I really don’t understand what the top page default timeframe setting does? Just set Topics per period to 5 and set the top page default timeframe to yearly. Now it shows me top posts today when i click top. Makes no sense to me


(cpradio) #19

PR Submitted

That is covered by the checkbox you unchecked earlier (as it will put the user on the landing page). Which is 100% in your control.

Yeah, that setting needed to be applied further, which is what my PR does. Now it should behave in a more intended way. The earlier existence was only helpful to very low activity forums, anything that had remotely any activity wouldn’t ever make use of that setting.

The PR changes that now.


(cpradio) #20

@commonpawn, it is merged now. If you are running latest or wish to pull it down, visit /admin/upgrade and you should be able to pull this in and it should give you better results.