Bug #70074

After saving tt_content, always jumps to top

Added by Michael Fritz about 5 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
-
Start date:
2015-09-24
Due date:
% Done:

50%

TYPO3 Version:
7
PHP Version:
7.1
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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...


Related issues

Related to TYPO3 Core - Feature #72908: Backend: Repositioning the page after a button is used Closed 2016-01-24
Related to TYPO3 Core - Feature #75462: Retain scroll position after deleting/hiding a content element New 2016-04-08
Related to TYPO3 Core - Bug #80273: Return to content element after closing for links of bodytext Closed 2017-03-14
Related to TYPO3 Core - Bug #80274: Return to content element after closing for hide/unhide links Closed 2017-03-14

Associated revisions

Revision baabff7a (diff)
Added by K J Kooistra over 4 years ago

[BUGFIX] Return to content element after closing

When editing a content element in the page module and (saving and)
closing it the view will now jump back to the content element.
This is especially useful for pages with a lot of content.

Resolves: #70074
Releases: master,7.6
Change-Id: Ica27bb561f3b3c19c56b38d211a75e22e018e090
Reviewed-on: https://review.typo3.org/49145
Reviewed-by: Wouter Wolters <>
Tested-by: Wouter Wolters <>
Tested-by: Bamboo TYPO3com <>
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>

Revision 47476ae2 (diff)
Added by K J Kooistra over 4 years ago

[BUGFIX] Return to content element after closing

When editing a content element in the page module and (saving and)
closing it the view will now jump back to the content element.
This is especially useful for pages with a lot of content.

Resolves: #70074
Releases: master,7.6
Change-Id: Ica27bb561f3b3c19c56b38d211a75e22e018e090
Reviewed-on: https://review.typo3.org/49123
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>

History

#1 Updated by Michael Fritz about 5 years ago

Actually it takes a lot of time for editors to scroll to the part again, where they edited the last time..

#2 Updated by Rafal Brzeski almost 5 years ago

best solution would be an ajax request, but this is I think an epic issue for future release :)

#3 Updated by Ben Robinson almost 5 years ago

It works if i open the element via pencil. If i open it by clicking on the text, it does not scroll down.

#4 Updated by Michael Fritz over 4 years ago

?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..

#5 Updated by Christoph Bessei over 4 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.

#6 Updated by KJ Kooistra over 4 years ago

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.

#7 Updated by Gerrit Code Review over 4 years ago

  • Status changed from New to Under Review

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/49123

#8 Updated by Gerrit Code Review over 4 years ago

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/49145

#9 Updated by Gerrit Code Review over 4 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/49145

#10 Updated by Gerrit Code Review over 4 years 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/49123

#11 Updated by Anonymous over 4 years ago

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

#12 Updated by S. G. over 3 years ago

  • % 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

#13 Updated by S. G. over 3 years ago

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

#14 Updated by Benni Mack about 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF