New Custom HomePage, Back to Forum URL

I came across the new custom homepage and it works great for adding a new page. But the “Back to Forum” link from the Admin page adds “/custom” onto the end of the URL. Presumably because this is not added to the Rails router, refreshing the page returns the dreaded " Oops! That page doesn’t exist or is private." message.

Is there any way round this?

We also plan on using the Doc Categories plugin, as used on this site for the Documentation category. That means a lot of users will also have the “Back to Forum” button.

Worst case scenario, I can probably re-write the “Back to Forum” URL in a theme component, the class name looks unique. But I’m wondering if there’s a better approach or maybe this is an edge case not previously identified, and needs a more robust fix adding to Discourse.

3 Likes

This provides similar functionality but provides a UI to edit your pages, of which you can have many (not just one).

And Rails knows about the routes …

The parent plugin (of which above is an extension) lives in this Topic:

2 Likes

Good catch @paulswithers. We should either add a Rails route for “/custom”, which is easy enough to do, or have the “Back to Forum” button just link back to “/”. Or even do both, to ensure “/custom” has parity with the other named routes.

Got a fix up here: FIX: Routing back to homepage from admin sidebar by pmusaraj · Pull Request #29125 · discourse/discourse · GitHub

4 Likes

Looks great, thanks for the quick turnaround.

2 Likes

Thank you for the update @pmusaraj. The back button works perfect now!

Refreshing the page on the /custom route still shows the “Oops” page. Is there a way to fix this as well?

I’m asking because, with a custom homepage, it’s common to need a custom “Home” link in the sidebar. Regular users typically prefer to set their default homepage to a list view like “Latest.” Without a custom sidebar link, they wouldn’t be able to navigate to the common homepage then. That’s why I’d always add a /custom link to the sidebar items.

image

Just in case that the wishlist is currently open for this, I’d be happy to provide even more detailed feedback… :innocent:

  • Would be great if such a “Home” link on the sidebar is also highlighted on the /custom route

  • Another detail I noticed working with the feature is that the route doesn’t have a translatable name yet. There is js.home, but it could be misleading when users have set a different page as their homepage. Well, I’m not sure how to best call this tbh.

1 Like

Yes, I had to revert that change because of an unrelated build issue. Will take a look at reinstating it soon.

1 Like