1
votes

Our customer wants, why the hell not, a Spanish Homepage, but the menu should refer to the English pages.

Unfortunately English isn't the default language in the system.

Is this somehow possible to achieve within TYPO3?

The menu is generated via Typoscript:

lib.nav = HMENU
lib.nav {
    wrap = <ul class="noListStyle">|</ul>
    entryLevel = 0

    1 = TMENU
    1 {
        noBlur = 1
        expAll = 1
        NO = 1
        NO {
            wrapItemAndSub = <li>|</li>
            ATagParams = data-id="{field:uid}"
            allStdWrap.insertData = 1
        }    

        CUR < lib.nav.1.NO
        CUR {
            wrapItemAndSub = <li class="active">|</li>
        }

        ACT < lib.nav.1.NO
        ACT {
            wrapItemAndSub = <li class="active">|</li>
        }

        IFSUB < lib.nav.1.NO
        IFSUB {
            wrapItemAndSub = <li class="hasChildren">|</li>
            # doNotLinkIt = 1
        }

        CURIFSUB = 1
        CURIFSUB {
            wrapItemAndSub = <li class="hasChildren active">|</li>
        }

        ACTIFSUB = 1
        ACTIFSUB {
            wrapItemAndSub = <li class="hasChildren active">|</li>
        }

        SPC = 1
        SPC {
            doNotLinkIt = 1
            doNotShowLink = 1
            allWrap = <li class="spacer">|</li>
        }
    }

    2 < lib.nav.1
    2 {
        wrap = <ul class="navSub">|</ul>
    }
}
1

1 Answers

2
votes

The solution to fallback to another language than the default one is using config.sys_language_mode = content_fallback. As you can read in the Docs, with this mode you can specify some language UIDs to which language you want to fallback: https://docs.typo3.org/typo3cms/TyposcriptReference/Setup/Config/Index.html#sys-language-mode

However, the content on the page can still fall back to another language, defined by the value of this keyword, e.g. content_fallback;1,3,0, to fall back to the content of sys_language_uid 1, after that to the content of sys_language_uid 3 and if that is not present either, to default (0).

In your case you still have to find a way, how to hide the spanish pages from the menue but having a fallback to english. Maybe there is something in the page language overlay configuration?

In the worst case you have get the page titles in the TMENU object "manually" by requesting the DB.

EDIT: And how about just naming the spanish pages titles with english titles by hand?