Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Checkbox to mark page as index #8615

Open
tpk109 opened this issue Jan 11, 2017 · 8 comments
Open

Checkbox to mark page as index #8615

tpk109 opened this issue Jan 11, 2017 · 8 comments
Labels

Comments

@tpk109
Copy link

tpk109 commented Jan 11, 2017

Hi,
if there is a page structure like

+Deutsch
-+Mainmenu (Forwading to Home)
--+Home

and I want Home callable through domain.de and not something like domain.de/home.html it only seems possible with a trick like:

+Deutsch
-+Index
-+Mainmenu
--+Home (Forwading to index)

How about a checkbox in the page "Make this the index"?

@asaage
Copy link

asaage commented Jan 11, 2017

Just set the alias of Home to index and you are done.

@tpk109
Copy link
Author

tpk109 commented Jan 11, 2017

You mean the Alias, right? If that is like index, you get an infinite circle, as the index calls Mainmenu, and Mainmenu calls Home again.

@asaage
Copy link

asaage commented Jan 11, 2017

My mistake - I can confirm the redirect-circle for the demo (which is contao 4) and 3.5.
Maybe index can only be a direct child of root-page? and has to be the first regular child?
In fact i have used forwarding-pages to build menu-structure before but never with the index-page nested inside.

@fritzmg
Copy link
Contributor

fritzmg commented Jan 11, 2017

@asaage Technically you can set the alias to index on any page. However, consider the following: when accessing the front end with an URL like http://example.org/ Contao does not have any information about which page should actually be accessed. Therefore Contao simply generates the first page within the respective website root. (If the the alias of that page is not index, Contao will redirect to its canonical URL.).

Now in the described scenario, Contao would display Mainmenu - but this is a redirect to Home which in turn has the alias index and thus its canonical URL is http://example.org/ and thus you'll get an infinite redirect.

While it is possible to set the alias to index for any other page as well, it does not make sense, because Contao will never know that you want this page to be the start page, since its canonical URL (http://example.org/) has no information about which page should be called.

In my opinion such a feature request does indeed make sense, because sometimes the site structure is categorized in some manner and you might want to have the start page somewhere within your site structure.

Instead of having a checkbox, Contao could also simply always display the page that has the alias index, if available. If not, it falls back to the first page of the website root.

@asaage
Copy link

asaage commented Jan 11, 2017

Thank you for clarification @fritzmg .
So as for now the sole purpose of setting the index alias on a page seems to be to prevent duplicate content like http://example.org/ and http://example.org/home.html.

@fritzmg
Copy link
Contributor

fritzmg commented Jan 11, 2017

Well not exactly. Since Contao 3.5.18 Contao automatically redirects http://example.org/ to http://example.org/home.html.

@asaage
Copy link

asaage commented Jan 12, 2017

Contao could also simply always display the page that has the alias index, if available. If not, it falls back to the first page of the website root.

That would at least be my favorite behaviour and could be a feature for contao 4.

https://github.com/contao/core/blob/master/system/modules/core/classes/Frontend.php#L348-L364
https://community.contao.org/de/showthread.php?65252-Problem-mit-Startseite-bei-interner-Weiterleitung
https://docs.contao.org/books/manual/3.5/de/03-seiten-verwalten/seitentypen.html#startseite

@tpk109
Copy link
Author

tpk109 commented Jan 12, 2017

If a solution with writing index into the alias would be used, then an directly readable instruction pointing to this would be nice. A basic feature like this should not need googling.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants