[TYPO3-dev] How to link to singleview from one ext to another

Søren Vedel sv at workhouse.dk
Thu Dec 7 15:43:43 CET 2006


Hi,

I have two extension. One for displaying products and the other for 
displaying recipes.

In the recipe ext I have a list of related products, but I can't fix the 
linking to the product singleview. My links keeps the recipe ext name 
while I need the foreign ext name.

This is my (wrong) link:
mysite/single-view.html?tx_recipes_pi1%5BshowUid%5D=2

While I need this:
mysite/single-view.html?tx_products_pi1%5BshowUid%5D=2


Here's a piece of code:

$query = '
SELECT DISTINCTROW tx_products.title, tx_products.uid, tx_products.pid
FROM tx_recipes_list, tx_products, tx_recipes_list_related_mm
WHERE uid_local = '.$this->internal['currentRow']['uid'].'
AND tx_products.uid = uid_foreign
ORDER BY tx_products.title
';

$res = $GLOBALS['TYPO3_DB']->sql_query($query);
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
   $content .= 
'<p>'.$this->pi_list_linkSingle($row['title'],$row['uid'],$cache=FALSE,array(),0,'258').'</p>';
}


1. How can I do this?

2. And how do I pick up the id from tx_products?


-- 
Med venlig hilsen/Kind regards
Søren Vedel
Workhouse Media




More information about the TYPO3-dev mailing list