Can I disable choosing a default homepage in users' Interface settings?

I did a theme where I don’t want users be able to change the default homepage on an individual basis:

Is there a way to disable this option? And could we re-define the default homepage for all users that have changed the option previously?

1 Like

You can hide it with CSS in your theme.

And when you change the default it will offer to update the user’s settings.

2 Likes

That sounds like what I’d be looking for, but I’m not offered an update when I change the settings here:

Screenshot from 2022-04-04 11-45-49

Oh. I may be wrong about that, then. Some settings let you do that, but not this one, I guess. Sorry. But maybe these will help:

See Administrative Bulk Operations or Edit a user setting for all Discourse users.

2 Likes

Ah yes, thanks for pointing me in the right direction @pfaffman :hugs:

The command on the rails console that worked:

UserOption.update_all(homepage_id:2)

And I hide the option with CSS:

.user-preferences-page {
    .control-group.home {
        display: none;
    }
}
1 Like

@nolo I’m curious: which page did you theme?

I’ve noted the top menu must contain at least “latest”, but haven’t used it for any amount of time to see if the various contexts for the top menu change it; for instance, “My Posts”, or “Unread”.

I find your decision to funnel folks to a single homepage an interesting option. :slight_smile:

(I normally set my home page to Unread, since I can just drop in real quick on many sites :bullettrain_side: .)

I use various components on Categories as the landing page and right now they are all set to the homepage route. So when users change the default homepage it gets messed up. I guess I can make it work down the line, so users can pick Latest as their homepage again. But it’s not a super quick fix and I need to fix it now :upside_down_face:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.