Project

General

Profile

Actions

Bug #91517

closed

Section-Link pointing the current page not rendering without config.baseURL

Added by Philipp Seiler almost 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2020-05-29
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
section,hash,baseurl,site,configuration,variant,base
Complexity:
Is Regression:
Sprint Focus:

Description

  • Have a typolink, e.g. created in a textmedia-element, that points to the same site to a different content element. The typolink should look something like <a href="t3://page?uid=123#456">Link to content element on the current page</a>, where 123 is the current site.
  • The base-tag on the site gets set via page.headerData in order to dynamically get BaseVariants from the SiteConfiguration. Works nicely without needing additional conditions or configurations. The TypoScript setting config.baseURL is not used.
  • Link will be rendered incorrectly in the frontend. It will point to the root-URL of the current SiteConfiguration without the current path segment. E.g. if the page would be located under my/path/segment/ and the dynamically set base-URL is https://www.mypage.com, the link should be https://www.mypage.com/my/path/segment#456, it is rendered however like https://www.mypage.com/segment#456. Incorrect link and redirect when clicking.
  • The Method generateUrlForPageWithSiteConfiguration of the class PageLinkBuilder checks if the TypoScript setting config.baseURL is set. If it is not set, then the URL is rendered incorrectly to the root-URL.
  • Setting config.baseURL resolves the problem. The link will then be rendered correctly.
  • However: As far as I can see, it is not possible to easily work with SiteConfigurations and BaseVariants with the config.baseURL-Setting.
  • If I am not mistaken, one would have to use e.g. TypoScript-Conditions for each variant to set config.baseURL. This seems pretty cumbersome. It is also not very nice to introduce lots of conditions depending on the URL into your setup.
  • Either there is a configuration method, that I have not considered yet, or the config.baseURL should be changed to be able to dynamically set it.
  • Or adjust the generateUrlForPageWithSiteConfiguration method?
Actions

Also available in: Atom PDF