Hallo,
anhand des Tutorial "Basic Player Profile" [url http://typo3.org/documentation/document-library/tutorials/player_profile_basic/current/][/url] hab ich mir meine erste kleine Extension gebastelt. Endlich werden auch die Bilder angezeigt und alle Einträge werden untereinander ausgegeben, wunderbar...
Nun möchte ich aber das pro Seite nur 10 Elemente ausgegeben werden und man dann durch die Datensätze browsen kann. Also ein Paging einbauen. Wie läuft das innerhalb der Extension? In Kaspers Video sieht das Innenleben der Extension wieder ganz anders aus.
Meine Extension bisher (Auszug):
function main($content,$conf) {
$this->conf = $conf;
$this->pi_setPiVarDefaults();
$this->pi_loadLL();
$content = "";
$GLOBALS["TSFE"]->set_no_cache();
$rows=$this->getItems();
while(list($c,$row) = each($rows)){
$this->conf["image."]["file"] = "uploads/tx_ext/".$row["bild"];
$theImgCode = $this->cObj->IMAGE($this->conf["image."]);
$content .= $theImgCode."<br />";
$content .= "<strong>".$row["hundeschule"]."</strong><br />";
$content .= "<hr /><br />";
}
return $this->pi_wrapInBaseClass($content);
}
function getItems(){
$config["pid_list"] = trim($this->cObj->stdWrap($this->conf["pid_list"],$this->conf["pid_list."]));
$config["pid_list"] = $config["pid_list"] ? implode(t3lib_div::intExplode(",",$config["pid_list"]),",") : $GLOBALS["TSFE"]->id;
list($pid) = explode(",",$config["pid_list"]);
$query = "SELECT * FROM tx_ext WHERE hidden = 0 ORDER BY sorting";
$res = mysql(TYPO3_db,$query);
$out=array();
while($row = mysql_fetch_assoc($res)){
$out[]=$row;
}
return $out;
}