Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LanguageNavigationItem and link string #105

Open
infabo opened this issue Jun 9, 2022 · 1 comment
Open

LanguageNavigationItem and link string #105

infabo opened this issue Jun 9, 2022 · 1 comment

Comments

@infabo
Copy link
Contributor

infabo commented Jun 9, 2022

Hi!

It is possibly not a good idea to convert the link-string (generated by LanguageMenuProcessor) to a Typolink class.

It is how TYPO3 LinkService resolve method works. It is not intended to "decode" slugs. As it is no modern t3://-string-representation and even no "legacy-notation" in the end - as slugs not existed before TYPO3 v9. This results in unpredictable behaviour. In this case LinkService thinks it is a folder.

For example for a language menu and a website homepage.

You have this possible original array data:

image

But this converts to this, if you use Navigation data structure:

image

Zoomed in:

image

see https://github.com/sitegeist/fluid-components/blob/master/Classes/Domain/Model/LanguageNavigationItem.php

Possibly it needs adaptions to the Typolink class. see https://github.com/sitegeist/fluid-components/blob/master/Classes/Domain/Model/Typolink.php#L58

@infabo
Copy link
Contributor Author

infabo commented Jun 9, 2022

On thing I have found, that could do the job would be the PageSlugCandidateProvider, in particular PageSlugCandidateProvider->getCandidatesForPath. see https://github.com/TYPO3/typo3/blob/11.5/typo3/sysext/core/Classes/Routing/PageSlugCandidateProvider.php#L73

This is at least how the PageRouter tries to resolve a path in first place. I think one could make use of it as well to resolve a "slug" to a page uid for Typolink class.

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

No branches or pull requests

1 participant