contao / core-bundle

[READ-ONLY] Contao Core Bundle
GNU Lesser General Public License v3.0
123 stars 58 forks source link

Why are pages of type root excluded from custom navigations? #1641

Closed Defcon0 closed 6 years ago

Defcon0 commented 6 years ago

Hello,

why is this the case? Would it be possible to include them? In fact I can choose them in the configuration in the backend but they won't be delivered.

Bye

fritzmg commented 6 years ago

Why do you want to select root pages? Those are not "real" pages.

Defcon0 commented 6 years ago

It's because of their title. The first page's title is "Startseite" ("Home" in English) whereas the root page's title is the title of the other domain ;-) Setting the title of the first real page ("Startseite") to the domain's name is no option in the context of this domain.

It's no technical issue but a contextual one.

fritzmg commented 6 years ago

In such a case I would create a internal redirect page with the title you desire and select that in your custom navigation module.

Defcon0 commented 6 years ago

Possible but sounds a bit like a workaround ;-) But ok, it's possible ;-)

leofeyer commented 6 years ago

It seems to me that a workaround is only required because of your prerequisites:

Setting the title of the first real page ("Startseite") to the domain's name is no option in the context of this domain.

@contao/developers Should we allow root pages in the custom navigation?

Toflar commented 6 years ago

It makes no sense to generate a navigation with root page types. I don't see any use case here.

Defcon0 commented 6 years ago

@leofeyer

Setting the title of the first real page ("Startseite") to the domain's name is no option in the context of this domain.

If I'd do so, all other navigations would have the corporate's name in them. Imagine a navigation like:

ACME Corp. | About us | Downloads | Imprint | ...

Understandably the customer wants the first point to be "Home" or something like that. Of course I could do all that logic in the template, but this wouldn't be necessary if one could just select the roots.

fritzmg commented 6 years ago

I thought you didn't want it to be Home?

Defcon0 commented 6 years ago

No ;-)

Needed situation is that the root is named like the domain (or company) and the first page is named „Home“. Now we need a custom nav where we select the roots so that the links are named like the domains (or companies).

The situation now is that we can without modification only have a nav list containing 4 times „Home“ because we cannot select the roots ;-)

leofeyer commented 6 years ago

As discussed in Mumble on August 30th, we want to include root pages in the custom navigation menu.

leofeyer commented 6 years ago

Implemented in contao/contao@912e3f7a64e92f808a086797d27ebb207b8dc479.

fritzmg commented 6 years ago

One "problem" I have with this are the generated URLs for the root pages. The contain the alias of the root page, which does not make much sense. The URL will then redirect you to the start page. (Unless that has changed already?)

leofeyer commented 6 years ago

So you suggest using the title of the root page but the alias of the first child page? Isn't that confusing for the users?

ausi commented 6 years ago

Wouldn’t it be better to use no alias at all?

The root page linking to example.com/ or example.com/en/ (depending on the prepend_locale setting) would make sense to me.

fritzmg commented 6 years ago

Yes, ideally the generated URL for a website root should be just the domain (and language, depending on prepend_locale).

asaage commented 6 years ago

So you suggest using the title of the root page but the alias of the first child page? Isn't that confusing for the users?

That is how internal Redirect-Pages without specific target work and i don't think it is confusing. But linking to domain.tld/[locale] without any alias sounds reasonable.

leofeyer commented 6 years ago

Implemented in contao/contao@3c92fb923e13678c7d47fe397ca6f398ff596515.

Defcon0 commented 5 years ago

Awesome, thanks :+1: !