[Typo3-shop] Image problems in single view
Jogvan Olsen
jo at atlanticvideo.dk
Thu Jan 6 19:18:43 CET 2005
Hi Alex
I have done the modifications you described but I still have problems. Where
I use ###PRODUCT_IMAGE### in my html template I get al 3 images displayed
together (same as before modifications). Where I use ###PRODUCT_IMAGE2### in
the template I only get the "noImageAvailable - image".
What am I missing?
PS.
I am using the 'Shop system (extended by ZK)' vesion.
Tanks,
Jogvan
// **************************
// Template marker substitution
// **************************
/**
* Fills in the markerArray with data for a product
*/
function getItemMarkerArray ($row,$catTitle, $imageNum=0,
$imageRenderObj="image") {
// Returns a markerArray ready for substitution with information for the
tt_producst record, $row
$markerArray=array();
// Get image
$theImgCode="";
$imgs = explode(",",$row["image"]);
$val = $imgs[0];
while(list($c,$val)=each($imgs)) {
if ($c==$imageNum) break;
if ($val) {
$this->conf[$imageRenderObj."."]["file"] = "uploads/pics/".$val;
} else {
$this->conf[$imageRenderObj."."]["file"] = $this->conf["noImageAvailable"];
}
$theImgCode.=$this->cObj->IMAGE($this->conf[$imageRenderObj."."]);
}
// **************************
// Modifiseret Jool
// **************************
$theImgCode2="";
$imgs2 = explode(",",$row["image2"]);
$val = $imgs2[0];
while(list($c,$val)=each($imgs2)) {
if ($c==$imageNum) break;
if ($val) {
$this->conf[$imageRenderObj."."]["file"] = "uploads/pics/".$val;
} else {
$this->conf[$imageRenderObj."."]["file"] = $this->conf["noImageAvailable"];
}
$theImgCode2.=$this->cObj->IMAGE($this->conf[$imageRenderObj."."]);
}
// **************************
// Modifiseret Jool SLUT
// **************************
// Subst. fields
$markerArray["###PRODUCT_TITLE###"] = $row["title"];
$markerArray["###PRODUCT_NOTE###"] = nl2br($row["note"]);
if (is_array($this->conf["parseFunc."])) {
$markerArray["###PRODUCT_NOTE###"] =
$this->cObj->parseFunc($markerArray["###PRODUCT_NOTE###"],$this->conf["parseFunc."]);
}
$markerArray["###PRODUCT_ITEMNUMBER###"] = $row["itemnumber"];
$markerArray["###PRODUCT_IMAGE###"] = $theImgCode;
// **************************
// Modifiseret af Jool SLUT
// **************************
$markerArray["###PRODUCT_IMAGE2###"] = $theImgCode2;
// **************************
// Modifiseret Jool SLUT
// **************************
// ZK+
"media.res | alex widschwendter" <a.widschwendter at mediares.at> wrote in
message
news:mailman.1.1105014325.11904.typo3-project-tt-products at lists.netfielders.de...
> Jogvan Olsen wrote:
>> In tt_product single-view i want to make layout like this:
>>
>> |--------------|---- --------------------------|------------ |
>> | | | |
>> | | |
>> image 3 |
>> | | Product Description |-------- --- |
>> | | |
>> | image 1 | |
>> | | |------------ |
>> | | | |
>> | | |
>> image 2 |
>> | | | |
>> -----------------------------------------------------------
>>
>> My problem is I can't separate my images.
>> I assign 3 images for each product. In List-view only image1 is shown
>> (which is OK), but in single-view al 3 images are displayed closely
>> packed together.
>> I can't figure out how to 'point' to image1, image2 and image3 in my
>> template so I can place the images where I want to.
>> Can anyone tell me the definition of image1, image2 .
>
>
> you have to define seperate markers in class.tx_ttproducts.php which you
> can use in your template.
>
> if you have a second image upload field in the BE use this, else use in
> line $val = $imgs2[0]; instead of 0 the index in the image field.
>
> $theImgCode2="";
> $imgs2 = explode(",",$row["image2"]);
> $val = $imgs2[0];
> while(list($c,$val)=each($imgs2)) {
> if ($c==$imageNum) break;
> if ($val) {
> $this->conf[$imageRenderObj."."]["file"] = "uploads/pics/".$val;
> } else {
> $this->conf[$imageRenderObj."."]["file"] =
> $this->conf["noImageAvailable"];
> }
> $theImgCode2.=$this->cObj->IMAGE($this->conf[$imageRenderObj."."]);
> }
>
>
> fill the marker:
>
> $markerArray["###PRODUCT_IMAGE2###"] = $theImgCode2;
>
> done!
>
>
> hth alex
More information about the TYPO3-project-tt-products
mailing list