简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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