tag zusammen,
ich schreibe grade meine erste größere Extension (schnittstelle zu Immoscout24) und hänge an einem Problem, das mir einen Knoten in die Denke macht.
Das Substituieren von Subparts funktioniert soweit sauber
wenn ich ein solch klassisches template habe:
<!-- ###THUMBNAILS### -->
<ul>
<!-- ###THUMB_ITEM### -->
<li>
<p>
###ThumbURL###<br>
###ThumbnailCaption###<br>
###PictureURL###
</p>
</li>
<!-- ###THUMB_ITEM### -->
</ul>
<!-- ###THUMBNAILS### -->
kein Ding soweit.
aber nun möchte ich die möglichkeit, die Items nochmal zu
gruppieren,
<!-- ###THUMBNAILS### -->
<ul>
<!-- ###THUMB_GROUP### -->
<li><ul>
<!-- ###THUMB_ITEM### -->
<li>
###ThumbURL###<br>
###ThumbnailCaption###<br>
###PictureURL###
</li>
<!-- ###THUMB_ITEM### -->
</ul></li>
<!-- ###THUMB_GROUP### -->
</ul>
<!-- ###THUMBNAILS### -->
so sollten immer x items in einer Gruppe sein und ygruppen pro liste...
mein Bisheriges php:
...
$subparts['template'] = $this->cObj->getSubpart($this->template, '###TEMPLATE_SINGLE###');
$subparts['thumbnail'] = $this->cObj->getSubpart($subparts['template'], '###THUMB_ITEM###');
...
$numThumbs = count($oXpath->nodeName('/ExposeResult/'.$nodeType.'/Attachments/Picture'));
$sizeGroup = $this->conf['single.']['thumbGroupSize'];
$numGroups = $numThumbs / $sizegroup;
$imageArray = $this->getImages($scoutId,$pictureType, $nodeType);
$thumbnailItem = '';
$thumbnailGroup= '';
$thumbnailArray = array();
$g_count = 1;
for( $i=1 ; $i <= $numThumbs ; $i++){
$thumbnailCaption = $oXpath->getData('/ExposeResult/'.$nodeType.'/Attachments/Picture['.$i.']/caption');
$thumbnailUrl = $oXpath->getData('/ExposeResult/'.$nodeType.'/Attachments/Picture['.$i.']/url');
if($thumbnailUrl !==''){
$thumbnailArray['###ThumbURL###'] = $thumbnailUrl;
$thumbnailArray['###ThumbnailWrappedCaption###'] = $this->cObj->stdWrap($thumbnailCaption,$this->conf['single.']['gallery.']['wrappedcaption']);
$thumbnailArray['###ThumbnailCaption###'] = $thumbnailCaption;
$thumbnailArray['###PictureURL###'] = $imageArray[$i];
}
$g_count++;
$thumbnailItem .= $this->cObj->substituteMarkerArray($subparts['thumbnail'], $thumbnailArray);
if($g_count % $sizeGroup){
// $subpartArray['###THUMB_GROUP###'] = $thumbnailItem;
// $thumbnailGroup .= $this->cObj->substituteMarkerArray($subparts['thumbgroup'], $thumbnailItem);
$g_count = 1;
}
}
$subpartArray['###THUMBNAILS###'] = $thumbnailItem;
$markerArray['###StartPictureUrl###'] = $imageArray[1];
...
$content .= $this->cObj->substituteMarkerArrayCached($subparts['template'], $markerArray, $subpartArray);
....
würde mich wirklich freuen, wenn ihr mir da einen Denkschubser geben könntet, da das grade der endspurt für die Extension ist.