Bug #81202

linkToTop in css_styled_content broken in TYPO3 7

Added by Simon Schaufelberger over 2 years ago. Updated 5 months ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Frontend
Target version:
Start date:
2017-05-11
Due date:
% Done:

100%

TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:
On Location Sprint

Description

Since config.prefixLocalAnchors was removed from the core with #65934 and outsourced into compatibility6 extension, all linkToTops are not working any more if realurl is used.

Testcase:

config {
  prefixLocalAnchors = all
  baseURL = http://www.example.com
}

page = PAGE
page {
  1 < styles.content.get
}

Add a new content element and check the checkbox "Append with Link to Top of Page" in Access tab.

This is the broken typoscript setup in css_styled_content:

https://git.typo3.org/Packages/TYPO3.CMS.git/blob/9219e4fa9af5e4bd2ea1f208056cb396667cce45:/typo3/sysext/css_styled_content/static/setup.txt#l537

Expected:

<a href="path/to/page.html#">Link to top</a>

Actual Output:

<a href="#">Link to top</a>

with a baseurl set links to the root page.

cssstyledcontentlinktotop.png View (203 KB) Joerg Kummer, 2018-08-12 12:46


Related issues

Related to TYPO3 Core - Bug #65934: Move prefixLocalAnchors to compatibility6 Closed 2015-03-23

Associated revisions

Revision 4c9d9254 (diff)
Added by Joerg Kummer 12 months ago

[BUGFIX] Add url for linkToTop in css_styled_content

This adds current URL to the ToTop link when css_styled_content is used.
Fixes broken linkToTop URL's since config.prefixLocalAnchors was removed.
Also compatible with TYPO3 v7 where compatibility6 is installed
and typoscript config.prefixLocalAnchors is configured.

Resolves: #81202
Releases: 8.7, 7.6
Change-Id: Id7b9f1c24575de297d2ca60af686fd6d299343e2
Reviewed-on: https://review.typo3.org/57778
Tested-by: TYPO3com <>
Reviewed-by: Johannes Seipelt <>
Reviewed-by: Riny van Tiggelen <>
Reviewed-by: Richard Vollebregt <>
Reviewed-by: Rudy Gnodde <>
Reviewed-by: Susanne Moog <>
Tested-by: Susanne Moog <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>

Revision c0b6023d (diff)
Added by Joerg Kummer 12 months ago

[BUGFIX] Add url for linkToTop in css_styled_content

This adds current URL to the ToTop link when css_styled_content is used.
Fixes broken linkToTop URL's since config.prefixLocalAnchors was removed.
Also compatible with TYPO3 v7 where compatibility6 is installed
and typoscript config.prefixLocalAnchors is configured.

Resolves: #81202
Releases: 8.7, 7.6
Change-Id: Id7b9f1c24575de297d2ca60af686fd6d299343e2
Reviewed-on: https://review.typo3.org/57775
Tested-by: TYPO3com <>
Reviewed-by: Richard Vollebregt <>
Reviewed-by: Susanne Moog <>
Tested-by: Susanne Moog <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>

History

#1 Updated by Simon Schaufelberger over 2 years ago

  • Related to Bug #65934: Move prefixLocalAnchors to compatibility6 added

#2 Updated by Simon Schaufelberger over 2 years ago

  • Description updated (diff)

#3 Updated by Simon Schaufelberger over 2 years ago

  • Description updated (diff)

#4 Updated by Simon Schaufelberger over 2 years ago

  • Description updated (diff)

#5 Updated by Simon Schaufelberger over 2 years ago

Found this snippet. Why not integrate it into the core?

tt_content.stdWrap.innerWrap2 = {LLL:EXT:css_styled_content/Resources/Private/Language/locallang.xlf:label.toTop}
tt_content.stdWrap.innerWrap2.stdWrap {
  typolink.parameter.data = TSFE:id
  typolink.section = top
  wrap = <p class="csc-linkToTop">|</p>
}

Source: https://typo3.org/documentation/snippets/sd/112/

#6 Updated by Christoph Lehmann over 2 years ago

Or maybe

tt_content.stdWrap.innerWrap2 = | <p class="csc-linkToTop"><a href="{getIndpEnv:TYPO3_REQUEST_URL}#">{LLL:EXT:css_styled_content/Resources/Private/Language/locallang.xlf:label.toTop}</a></p>

#7 Updated by Susanne Moog almost 2 years ago

  • Category changed from Content Rendering to Frontend
  • Complexity set to easy

#8 Updated by Riccardo De Contardi over 1 year ago

  • Sprint Focus set to On Location Sprint

#9 Updated by Joerg Kummer about 1 year ago

It also occurs in TYPO3 v8.

I'm on it

#10 Updated by Gerrit Code Review about 1 year ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57774

#11 Updated by Gerrit Code Review about 1 year ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57775

#12 Updated by Gerrit Code Review about 1 year ago

Patch set 2 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57775

#13 Updated by Gerrit Code Review about 1 year ago

Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57778

#14 Updated by Gerrit Code Review about 1 year ago

Patch set 2 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57778

#15 Updated by Joerg Kummer about 1 year ago

To reproduce this issue, install EXT:reaurl & EXT:css_styled_content.
Create a subpage (you need a human speaking url path in frontend).
Create a standard content element, where you check 'Append with Link to Top of Page' under tab 'Appearance'.
Set TS template for this page (or pagetree) as root (option clear constants and setup) with setup as in this description and include css_styled_content extension template.

The 'Link to top' does not contain full path, without the patch in TYPO3 8 and 7.

#16 Updated by Joerg Kummer 12 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#17 Updated by Benni Mack 5 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF