Reputation: 889
The django-cms always uses the top-most page as the start/landing page. I now want to have a navigation that looks like this foo-home-bar and home to be the landing page.
One way would be to add a dummy page at / that redirects to /home, but this seems a bit crude to me. Is there any better solution? I don't mind changing the code of the cms itself.
Upvotes: 7
Views: 7299
Reputation: 1
The page with the lowest-numbered tree_id in the cms_page table is the home page. This will normally be the first page that you created. If you want to make a different page your home page, you can manually change the tree_id values in your database (but unfortunately not by using the admin.)
Upvotes: 0
Reputation: 150
The easiest way, instead of creating a page that redirect is to just use django's redirect generic view.
set it in your top level urls.py
url(r'^$', RedirectView.as_view(url='/home/')),
and of course add the from django.views.generic.base import RedirectView
import at the beginning and you should be all set.
('^$'
only catches the root url and the RedirectView redirect wherever you want. I was a bit unsure about using it myself, but I saw a lot of major websites doing a redirect when you get on to their site...)
Upvotes: 7
Reputation: 11
The first page you make seems to be the home page, simply add other root pages as needed and enable navigation on them. This is what i have done.
Our first page was test, and then some child pages. in the admin page you can click and drag the pages around to change the child/parent order. we renames test to home and shifted the child pages to another root page.
You can also override the default menu by make a template in menu/menu.html
In there you could override the order by adding in some if statements.
You could also hardcode it in your base.html having the menu something like:
<ul id=menu>
<li><a href="/foo/>foo></a></li>
<li><a href="/">Home</a></li>
{% show_menu %}
<ul>
And just have bar and the other pages you wanted in the navigation but not foo or home.
The homepage has an icon on it that the other pages wont, denoting the root page I guess.
Upvotes: 1