Bug #16794
closed
Disable section name link and eliminate wrong link format
Added by Andreas Kastl almost 18 years ago.
Updated about 6 years ago.
Description
Section name is always formatted with a static link (anchor # + JavaScript code). Link is not really necessary and is formatted in a wrong way. config.prefixLocalAnchors does currently not affect this link due to hardcoding of a-tag, but is necessary, if e.g. using realurl and/or base URL in HTML header.
Bug:
- make link compliant to prefixLocalAnchors / xhtml_cleaning
Feature request:
- make this link generation configurable (enable / disable link generation for section names via TS). For "unknown sections" there is no link, too. A link is not necessary from my point of view (and is not compatible to accessibility standards).
Relevant code fragment from pi-class (CVS 1795):
750 $onclick = 'document.'.$this->prefixId.'[\''.$this->prefixId.'[_sections]\'].value=\''.$theRLid.'\';document.'.$this->prefixId.'.submit();return false;';
751 $sectionTitleLinked = '<a href="#" onclick="'.htmlspecialchars($onclick).'">'.htmlspecialchars($sectionName).':</a>';
(issue imported from #M4667)
Since you seem to have the solution ready, I would like you to provide a patch. I will have a look at it then.
I just changed lines 750 and 751 to disable link generation completely, but this may not be the solution you are looking for:
$sectionTitleLinked = htmlspecialchars($sectionName);
I'm not really familiar with link generator classes / functions of typo3 and xhtml_cleaning mechanism.
The reason for the bug may be eventually that your link does not contain anchor name (only '#' instead of '#name'). Perhaps this hides it from xhtml cleaning (not tested)? Your other links inside browsebar (to link to anchors '#'+md5 of id) work very well and are cleaned out correctly.
It may be useful to modify following function as well since it uses static anchor in code and (in-accessible) javascript, too (don't know if and where it is used):
function makePointerSelector_link
related to #9574 (patch 0009574_v7.patch)
- Status changed from New to Under Review
I'd suggest to have a TS property which can turn off linking of section titles:
plugin.tx_indexedsearch.linkSectionTitles
So if there are problems with these "drill" links depending on setup of the system, one can turn of this hardcoded linking. It is still possible (and easy) to add such drill links on section titles using unobstrusive JavaScript instead.
Apart from that a no-brainer imo.
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/20193
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/20193
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/20193
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF