Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If a custom home page is set in the ACP (General -> Homepage), page is redirected, not directly rendered #5993

Closed
julianlam opened this issue Oct 19, 2017 · 6 comments
Assignees
Milestone

Comments

@julianlam
Copy link
Member

e.g. if I set the home page to /user/admin, then navigating to my forum at http://localhost/forum will redirect me to http://localhost/forum/user/admin.

This doesn't happen if I set the homepage to a non-custom option, like "Recent". Not sure if this is too difficult to resolve for custom pages?

@Jenkler
Copy link

Jenkler commented Oct 19, 2017

If it is possible to patch this fairly easy, could we merge this patch to 1.6.1?

@barisusakli
Copy link
Member

This is difficult to fix for custom pages, it is easy for pages like recent because we just call res.render('recent', data). When the custom page is /user/admin res.render('/user/admin', data); does not work since there is no template named '/user/admin`.

@pitaj
Copy link
Contributor

pitaj commented Oct 19, 2017

We could overwrite req.url

@Jenkler
Copy link

Jenkler commented Oct 19, 2017

But when we specify the template /user/admin in custom pages the template shoud exist or is that a special template?
Why not do as in the old custom homepage plugin with a static page called something like homepage.tpl and write in the doc that homepage is used for the / page!
Overwriting req.url sounds like a quickfix if that works.

@barisusakli
Copy link
Member

@Jenkler try custom-homepage@0.2.3 it should work on 1.6.0+

@Jenkler
Copy link

Jenkler commented Oct 19, 2017

Thanks @barisusakli, Yes custom-homepage@0.2.3 works for 1.6.1 :)
But it would be nice to have one plugin for all if that would be possible.

So what do we think, is it possible to get custom-pages to work this way also? Or is it a downside to modify nodebb core to fix this?

@barisusakli barisusakli added this to the 1.7.0 milestone Nov 3, 2017
pitaj added a commit that referenced this issue Nov 3, 2017
Also a nice newline so the line doesn't get overwritten when running `./nodebb upgrade`
pitaj added a commit that referenced this issue Nov 3, 2017
Also a nice newline so the line doesn't get overwritten when running `./nodebb upgrade`
pitaj added a commit that referenced this issue Nov 3, 2017
Also a nice newline so the line doesn't get overwritten when running `./nodebb upgrade`
barisusakli pushed a commit that referenced this issue Nov 4, 2017
* Better fix for #5993

Also a nice newline so the line doesn't get overwritten when running `./nodebb upgrade`

* Optimizations for custom homepage

Move it into a separate module
pitaj added a commit that referenced this issue Nov 6, 2017
Also a nice newline so the line doesn't get overwritten when running `./nodebb upgrade`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants