ok, also...
ich hab mit dem Kickstarter eine Extension mit 2 Tabellen erstellt.
Tabelle 1
uid wert1 ...
3 xyz ...
4 xyz ...
Tabelle 2
uid wert rel
1 1234 3
2 1235 3
3 1236 4
Tabelle2.rel ist im Kickstarter als Database Relation zu Tabelle1.uid definiert.
Unter 'Frontend Plugins' hab ich bei 'If you have configured custom tables you can select one of the tables to list by default as an example:' Tabelle 2 ausgewählt.
Dadurch generiert der Kickstarter folgenden Code für die Ausgabe als Liste:
function listView($content,$conf) {
$this->conf=$conf; // Setting the TypoScript passed to this function in $this->conf
$this->pi_setPiVarDefaults();
$this->pi_loadLL(); // Loading the LOCAL_LANG values
$this->pi_USER_INT_obj=1; // Configuring so caching is not expected. This value means that no cHash params are ever set. We do this, because it's a USER_INT object!
$lConf = $this->conf["listView."]; // Local settings for the listView function
if ($this->piVars["showUid"]) { // If a single element should be displayed:
$this->internal["currentTable"] = "tx_table_2";
$this->internal["currentRow"] = $this->pi_getRecord("tx_table_2",$this->piVars["showUid"]);
$content = $this->singleView($content,$conf);
return $content;
} else {
$items=array(
"1"=> $this->pi_getLL("list_mode_1","Mode 1"),
"2"=> $this->pi_getLL("list_mode_2","Mode 2"),
"3"=> $this->pi_getLL("list_mode_3","Mode 3"),
);
if (!isset($this->piVars["pointer"])) $this->piVars["pointer"]=0;
if (!isset($this->piVars["mode"])) $this->piVars["mode"]=1;
// Initializing the query parameters:
list($this->internal["orderBy"],$this->internal["descFlag"]) = explode(":",$this->piVars["sort"]);
$this->internal["results_at_a_time"]=t3lib_div::intInRange($lConf["results_at_a_time"],0,1000,1); // Number of results to show in a listing.
$this->internal["maxPages"]=t3lib_div::intInRange($lConf["maxPages"],0,1000,1);; // The maximum number of "pages" in the browse-box: "Page 1", "Page 2", etc.
$this->internal["searchFieldList"]="zip";
$this->internal["orderByList"]="uid,zip";
// Get number of records:
$res = $this->pi_exec_query("tx_table_2",1);
list($this->internal["res_count"]) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
// Make listing query, pass query to SQL database:
$res = $this->pi_exec_query("tx_table_2");
$this->internal["currentTable"] = "tx_table_2";
// Put the whole list together:
$fullTable=""; // Clear var;
// Adds the search box:
$fullTable.=$this->pi_list_searchBox();
// Adds the whole list table
$fullTable.=$this->pi_list_makelist($res);
// Returns the content from the plugin.
return $fullTable;
}
}
Jetzt möchte ich gerne mit pi_list_searchBox() Tabelle2.wert suchen und über die Relation Tabelle2.rel->Tabelle1.uid die Werte von Tabelle1 ausgeben.
Die SQL-Abfrage dafür steht oben, aber ich weiß nicht, wie genau ich die Funktion listView() modifizieren muss, damit er mir als Suchergebnis die Werte aus Tabelle 1 ausgibt und nicht die Werte aus Tabelle 2.
Vielen Dank!