Project

General

Profile

Actions

Feature #19832

open

sectionMarker (page anchor) prefix is hardcoded as "c"

Added by Michiel Roos almost 16 years ago. Updated over 4 years ago.

Status:
Accepted
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2009-01-15
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
hard
Sprint Focus:

Description

sectionMarker (page anchor) prefix is hardcoded as "c" while it is freely configurable in css styled content.

You can change the page anchor from the default:
tt_content.stdWrap.dataWrap = <a id="c{field:uid}"></a> |

To something like:
tt_content.stdWrap.innerWrap.cObject.default.10.value = <div id="section-{field:uid}">|</div>

Or
tt_content.stdWrap.innerWrap.cObject.default.10.value = <div id="content-element-{field:uid}">|</div>

Although it is longer, it's more descriptive.

The point is that is is changeable by the user. But the anchor prefix is hardcoded in the core as being "c".

This is in the following files:
sysext/cms/tslib/class.tslib_content.php (line 5268 and line 5390)
sysext/simulatestatic/class.tx_simulatestatic.php (line 166)

(issue imported from #M10147)


Files

bug-10147.diff (2.9 KB) bug-10147.diff Administrator Admin, 2011-03-17 16:25

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #73621: Make anchors editableClosed2016-02-23

Actions
Actions #1

Updated by Oliver Hader almost 16 years ago

Good one! You could provide a patch if you'd like to... ;-)

Actions #2

Updated by Michiel Roos over 13 years ago

Ugly patch attached.

It looks like some more magic is needed since the user may specify other tt_content fields too:

<div id="content-element-{field:uid}-{field:crdate}-blah">

But it fixes the simplest case where only uid is used.

Actions #3

Updated by Xavier Perseguers over 13 years ago

  • Category deleted (Communication)
  • Target version deleted (4.6.0-beta1)
Actions #4

Updated by Thorsten Kahler over 13 years ago

  • Category set to Frontend
  • Status changed from New to Accepted
  • PHP Version changed from 4.3 to 5.2
  • Complexity set to hard
Actions #5

Updated by Alexander Opitz about 10 years ago

  • Status changed from Accepted to Needs Feedback
  • Is Regression set to No

Hi Michiel,

what's the state of this issue?

Actions #6

Updated by Riccardo De Contardi almost 10 years ago

Still present in 6.2 I guess:

/typo3/sysext/core/Classes/TypoScript/TemplateService.php, line 1529:

$LD['sectionIndex'] = $page['sectionIndex_uid'] ? '#c' . $page['sectionIndex_uid'] : '';

/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php,
line 5740:
$sectionMark = $sectionMark ? (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($sectionMark) ? '#c' : '#') . $sectionMark : '';

line 5946:
$sectionMark = (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($sectionMark) ? '#c' : '#') . $sectionMark;

The string " '#c' " is also present in:
/typo3/sysext/linkvalidator/Classes/LinkAnalyzer.php
/typo3/sysext/linkvalidator/Classes/LinkType/InternalLinktype.php

Actions #7

Updated by Frans Saris over 9 years ago

  • Tracker changed from Bug to Feature
  • Status changed from Needs Feedback to Accepted
  • PHP Version deleted (5.2)
Actions #8

Updated by Susanne Moog over 6 years ago

  • Sprint Focus set to On Location Sprint
Actions #9

Updated by Gerrit Code Review over 6 years ago

  • Status changed from Accepted 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/57321

Actions #10

Updated by Patrick Schriner over 6 years ago

I made a patch, though I'm not sure this should even be solved. It's an edge case.

Actions #11

Updated by Gerrit Code Review over 6 years ago

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

Actions #12

Updated by Joerg Kummer over 6 years ago

To test this behaviour following typoscript setup will help.
Use this setup as root typoscript template on any page with some content elements of any kind (header needed).

/**
* TypoScript setup to test issue #18932
*/

// New config variable 'sectionLinkPrefix' - you need to adapt content wraps
// (typo3/sysext/fluid_styled_content/Resources/Private/Layouts/Default.html)
config.sectionLinkPrefix = section-element

// Default menu - with section index enabled
// (https://docs.typo3.org/typo3cms/TyposcriptReference/MenuObjects/Sectionindex/Index.html)
lib.defaultMenu = HMENU
lib.defaultMenu {
    entryLevel = 0
    1 = TMENU
    1.NO = 1
    1.NO.allWrap = <li>|</li>
    1.wrap = <ul>|</ul>
    1.sectionIndex = 1
    1.sectionIndex.type = all
    2 = TMENU
    2.NO = 1
    2.NO.allWrap = <li>|</li>
    2.wrap = <ul>|</ul>
    2.sectionIndex = 1
    2.sectionIndex.type = all
    stdWrap.outerWrap = <h2>Default menu - HMNEU with section index enabled</h2>|<hr />
}

// Section Menu - typolink with section in a CONTENT obj rendering context (integer)
lib.sectionMenuInteger = CONTENT
lib.sectionMenuInteger {
    table = tt_content
    renderObj = TEXT
    renderObj {
        field = header
        typolink {
            parameter.data = TSFE:id
            section.field = uid
            wrap = <li>|</li>
        }
    }
    wrap = <ul>|</ul>
    stdWrap.outerWrap = <h2>Section Menu - typolink with section in a CONTENT obj rendering context, where section field is integer (uid)</h2>|<hr />
}

// Section Menu - typolink with section in a CONTENT obj rendering context (string)
lib.sectionMenuString = CONTENT
lib.sectionMenuString {
    table = tt_content
    renderObj = TEXT
    renderObj {
        field = header
        typolink {
            parameter.data = TSFE:id
            section.field = header
            wrap = <li>|</li>
        }
    }
    wrap = <ul>|</ul>
    stdWrap.outerWrap = <h2>Section Menu - typolink with section in a CONTENT obj rendering context, where section field is string (header)</h2>|<hr />
}

// Section link - simple typolink with section
lib.sectionLink = TEXT
lib.sectionLink {
    value = Link to this page
    typolink {
        parameter.data = TSFE:id
        section.field = uid
    }
    wrap = <h2>Section link - simple typolink with section</h2>|<hr />
}

// Page object - collects all examples above
page = PAGE
// Default menu
page.10 < lib.defaultMenu
// Section menu
page.20 < lib.sectionMenuInteger
page.30 < lib.sectionMenuString
// Section link
page.40 < lib.sectionLink
// Content
page.100 < styles.content.get

Actions #13

Updated by Susanne Moog over 5 years ago

  • Status changed from Under Review to Accepted

Review was abandoned.

Actions #14

Updated by Susanne Moog almost 5 years ago

  • Sprint Focus deleted (On Location Sprint)
Actions #15

Updated by Riccardo De Contardi over 4 years ago

Searched for "'#c'" string on latest master(10.4.0-dev) and found it in these files:

/typo3/sysext/backend/Classes/ContextMenu/ItemProviders/RecordProvider.php

/typo3/sysext/backend/Classes/Controller/EditDocumentController.php

/typo3/sysext/linkvalidator/Classes/LinkAnalyzer.php

/typo3/sysext/linkvalidator/Classes/Linktype/InternalLinktype.php

/typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php

Actions

Also available in: Atom PDF