How to get ID of current page in TYPO3

99封情书 提交于 2020-07-05 03:06:20

问题


I'm using TYPO3 v8, how can I get the id of the current page that I'm editing in the backend?


回答1:


You can get current PageId like this.

in Controller file.

$currentPid = $GLOBALS['TSFE']->id

Using Typoscript.

temp.page_uid = TEXT
temp.page_uid.field = uid



回答2:


Example: In your controller:

$id = (int)\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id');



回答3:


This depends on context, examples:

  • If you are extending FormEngine (editing records), the parent page record is in the data array, prepared by some rather early data provider.
  • If you are adding a feature to the 'info' module, the page id is a GET parameter, you should be able to access this in your controller.


来源:https://stackoverflow.com/questions/48103446/how-to-get-id-of-current-page-in-typo3

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!