stephenmcd / mezzanine

CMS framework for Django
http://mezzanine.jupo.org
BSD 2-Clause "Simplified" License
4.75k stars 1.64k forks source link

[BUG] Documentation not clear about chaning the default site home page #2051

Open damascene opened 1 year ago

damascene commented 1 year ago

Is there an existing issue for this?

Current Behavior

When you create a new site you pretty much gives you a ready to fill website but it seems the default generic home page is not so easy to change it requires working with configuration files and running some commands.

Issue is that documentation is not sufficient to change the default home page.

Expected Behavior

Home page should be easy to change and instructions should be clear.

Steps To Reproduce

  1. Install the app

Environment

- Latest version
- All OSs

Anything else?

The main resource for changing the home page is linked in the generic page it self under: Changing this homepage

However it points out to a section titled "Why isn't the homepage a Page object I can edit via the admin?" which doesn't really contain much information about changing the page but gives hints to get started.

However, the suggested methods has the following issues:

First Method (Template)

It requires to run collect templates python manage.py collecttemplates I figured it by checking a discussion about an issue.

After that you will get a template dir with index.html in it which you can modify I wasn't able to find it in the official guide.

Second Method (Editor page)

It make the page editable in the editor: it requires to disable the default template line:

    #path("", TemplateView.as_view(template_name="index.html"), name="home"),

Enable this line:

    path("", mezzanine.pages.views.page, {"slug": "/"}, name="home"),

and import mezzinine or import views from mezzanine.pages:

from mezzanine.pages import views

and modify path to the following:

    path("", views.page, {"slug": "/"}, name="home"),

This was not in the official guide.

I find instructions after searching for sometime inside one of the closed issues and modified it to my needs.

urls.py file in project dir contains some hints but also missing some vital information.

henri-hulski commented 1 year ago

Hi @damascene! Thank you for bringing this up. We don't have the resources to fix the docs atm, but I would except a PR to fix it. So it would be great if you could create a PR to fix it.