dusty
dusty

Reputation: 189

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

Upvotes: 1

Views: 1170

Answers (1)

biesior
biesior

Reputation: 55798

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.

Upvotes: 3

Related Questions