简体   繁体   English

如何在Typo3的后端获得页面的'realurl'网址

[英]How can I get 'realurl' url of page in backend of Typo3

I have started to develope a 'post edit content hook' now I need to get 'realurl' of desired page. 我已经开始开发一个'post edit content hook',现在我需要获得所需页面的'realurl'。 How can I do this? 我怎样才能做到这一点?

I have registered a hook: 我已经注册了一个钩子:

$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][]
    = 'EXT:' . $_EXTKEY .'/Classes/Hooks/ContentEdit.php:\xxx\xxx\Hooks\ContentEdit';

and Class: 和班级:

   class ContentEdit

{
    function processDatamap_postProcessFieldArray($status, $table, $id, &$fieldArray, &$pObj) {
        if($table == 'pages'){
            if ($id !== null){
                // need to get url of page
            }
        }
    }
}

There's no direct way to do this, as RealURL relies on TSFE which isn't available on BE, anyway there's workaround extension created by Dmitry Dulepov - author of RealURL - Page path which allows you to grab resolved RU path within BE module, scheduler's task, etc. 没有直接的方法可以做到这一点,因为RealURL依赖于BE上没有的TSFE ,无论如何都有由Dmitry Dulepov创建的变通方法扩展 - RealURL的作者 - 页面路径允许您在BE模块中获取已解析的RU路径,调度程序的任务等

NOTE: This ext just makes a call to the eID script, which generates proper page path, in other words it simulates FE click, therefore it will probably will be able to work not only with RU, but also with CoolURI and other similar extensions. 注意:这个ext只调用eID脚本,它生成正确的页面路径,换句话说它模拟FE点击,因此它可能不仅可以用于RU,还可以用于CoolURI和其他类似的扩展。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM