Bug #70074
closed
After saving tt_content, always jumps to top
Added by Michael Fritz over 8 years ago.
Updated over 5 years ago.
Category:
Backend User Interface
Description
IS: When I save a tt_content element and close it, the viewport always jumps to the top of the page in the backend.
SHOULD: It should jump to the element I just edited or created.
This is the same for save and view tt_content, it could use the anchor like #c9182 to jump to the element in the frontend side.
This would make it easier to edit and check content in the backend..
However I have the feeling this feature was there in the past but vanished in 6.2...
Actually it takes a lot of time for editors to scroll to the part again, where they edited the last time..
best solution would be an ajax request, but this is I think an epic issue for future release :)
It works if i open the element via pencil. If i open it by clicking on the text, it does not scroll down.
?Ajax-Request?
Best solution would be to add an achor to the preview link for instance:
website.de/?id=123#Anchor1
Then all I had to do is add anchors to all my tt_content elements, which I do anyways..
And I remember it worked some years ago..
It would be really nice if this could be fixed/implemented.
As Michael said it would save the editors a lot of time.
I've seen this work just fine in 6.2. Are you using gridelements by any chance? Because it doesn't work with nested gridelements: https://forge.typo3.org/issues/73093
It doesn't work anymore in TYPO3 7.6 though. I got it fixed by updating TYPO3\CMS\Backend\View\PageLayoutView::tt_content_drawHeader() and changing line 1399 to:
'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI') . '#element-tt_content-' . $row['uid']
However I'm not sure if this is a good way to fix it.
- Status changed from New to Under Review
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- % Done changed from 100 to 50
- TYPO3 Version changed from 6.2 to 7
- PHP Version changed from 5.6 to 7.1
Hi,
in the same id, I add the same param in the function linkEditContent (line 1895 for typo3 7.6.16)
public function linkEditContent($str, $row)
[...]
'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI') . '#element-tt_content-' . $row['uid']
[...]
}
Without that the right callback url is written only on header and not when we click on the bodytext.
Thanks for including
as well on hidding and unhidding (line: 1399 for typo3 7.6.16) :
public function tt_content_drawHeader($row, $space = 0, $disableMoveAndNewButtons = false, $langMode = false, $dragDropEnabled = false)
{
[...]
if ($hiddenField && $GLOBALS['TCA']['tt_content']['columns'][$hiddenField]
&& (!$GLOBALS['TCA']['tt_content']['columns'][$hiddenField]['exclude']
|| $this->getBackendUser()->check('non_exclude_fields', 'tt_content:' . $hiddenField))
) {
if ($row[$hiddenField]) {
$value = 0;
$label = 'unHide';
} else {
$value = 1;
$label = 'hide';
}
$params = '&data[tt_content][' . ($row['_ORIG_uid'] ? $row['_ORIG_uid'] : $row['uid'])
. '][' . $hiddenField . ']=' . $value;
$out .= '<a class="btn btn-default" href="' . htmlspecialchars(BackendUtility::getLinkToDataHandlerAction($params))
/* ADD THIS LINE */ . '#element-tt_content-' . $row['uid']
. '" title="' . $this->getLanguageService()->getLL($label, true) . '">'
. $this->iconFactory->getIcon('actions-edit-' . strtolower($label), Icon::SIZE_SMALL)->render() . '</a>';
}
[...]
}
thanks
- Status changed from Resolved to Closed
Also available in: Atom
PDF