[TYPO3-dev] How to get a link to a FE page from a BE module?

Ricardo Scachetti Pereira ricardo at tdwg.org
Sat Apr 8 14:40:53 CEST 2006


    Hi Oliver,

    I tried your suggestion but got this error:

*Fatal error*: Call to a member function on a non-object in *C:\Program 
Files\Apache 
Group\Apache2\htdocs\dummy-3.8.0\tslib\class.tslib_content.php* on line 
*4961*

    Here's the code where it happens (faulty line marked with >>>):

function typoLink($linktxt, $conf)    {
...
            // Looking up the page record to verify its existence:
 >>>     $disableGroupAccessCheck = 
$GLOBALS['TSFE']->config['config']['typolinkLinkAccessRestrictedPages'] 
? TRUE : FALSE;
        $page = 
$GLOBALS['TSFE']->sys_page->getPage($link_param,$disableGroupAccessCheck);
...
}

    Debuging that bit I checked that the global variable 
$GLOBALS['TSFE'] is empty. Maybe I need to initialize other stuff as well.

    In any case, your suggestion is a great lead. I'll let you know if I 
get it working. Thanks so very much!!

    Cheers,

Ricardo

Oliver Klee wrote:

>Hi,
>
>Ricardo Scachetti Pereira schrieb:
>  
>
>>   I've been trying to render a link to a front-end page on my back-end
>>module, without success.
>>
>>   I've used the pi_getPageLink() function and friends (typolink) in
>>some plugins I have developed without any problems, but I don't know how
>>to do the same from my back-end module because I don't have an instance
>>of the pi_base class at hand.
>>    
>>
>
>What happens if you create a pi_base object for this? Usually, a content
>object also should suffice as it provides getTypoLink().
>
>This may work (not tested):
>
>$cObj =& t3lib_div::makeInstance('tslib_cObj');
>$linkTag = $cObj->getTypoLink('view it', $pageID);
>
>Hope this helps,
>
>
>Oliver
>_______________________________________________
>TYPO3-dev mailing list
>TYPO3-dev at lists.netfielders.de
>http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev
>
>  
>





More information about the TYPO3-dev mailing list