[Typo3-dev] Some questions concerning extension programming

Andreas Bulling spam at phoenix.hadiko.de
Tue Nov 29 13:04:42 CET 2005


Hi Bernhard,

first, thanks for your answer and help!

| "section" is the way to go.

OK, so it's right that the TYPO3 functions just lack such a parameter
and one has to do it manually?! Does anyone know if there is a plan
to add this to the upcoming 4.0 release?
Would be a nice thing to have IMHO...
 
| If you are writing a FE-Plugin try:
| $link = $this->cObj->typoLink( $category, $conf );

I tried that but unfortunately the path to the page is still omitted.
The code is the following now:

if( $this->viewMode == 'TREE' )	{
	$conf = array(
		'useCacheHash' => $this->pi_USER_INT_obj ? 0 : $this->allowCaching,
		'no_cache' => $this->pi_USER_INT_obj ? 0 : $this->allowCaching,
		'parameter' => $pageID,
		'section' => 'cat_' . $categoryUID,
	);

	$link = $this->cObj->typoLink( $category, $conf );
	$content = ' ' . $link . $content;
} else	{
	$content = ' ' . $this->pi_LinkTP( $category, array( 'tx_ablinklist_pi1[category_uid]' => $categoryUID ), $this->allowCaching, $pageID ) . $content;
}	

pi_linkTP() in the else branch creates a "correct" link, typoLink() in the if branch not?!

| If you want to call the typoLink method from a "subclass" of you extension
| just pass the $this pointer to an ->init() method of the subclass:
|
| [...]
| 
| if you REALLY need to instanciate your own cObj you will have to set some variables
| in it so it works correctly (AFAIK is valid for everthing :)

I don't understand why you are talking about "subclassing" here :(
Perhaps because before I had local_cObj in the code?
I thought that it's usual behaviour to do a

$this->local_cObj = t3lib_div::makeInstance( 'tslib_cObj' );

in the main() function of an extension as I saw it in other ones?!
Or is this not needed?

| If everything fails have a look if $pageID is really set. If 'parameter' is set at least
| a link to the correct page should get generated.

Right, this kind of link is created. Both with local_cObj and cObj.

Thanks again, sincerly,
  Andreas




More information about the TYPO3-dev mailing list