Hi,
im Backend lässt sich unter Einstellungen -> Kategorie/Produkte -> Die "Anzahl von Kategorien in der Reihe" einstellen. Ich möchte die Anzahl der Kategorien auf 4 festlegen, allerdings sollen bei Unterkategorien nur 2 nebeneinander dargestellt werden.
Habe mir daher gedacht, ich stelle im Backend "4" ein und verändere den PHP-Code des Skriptes components/com_jshopping/templates/default/category/category_default.php
Nur leider weiß ich nicht weiter. Fürs Backend sieht es ja so aus (Einstellung Anzahl von Produkt-Kategorien):
<tr>
<td class="key">
<?php echo _JSHOP_COUNT_CATEGORY_ROW;?>
</td>
<td>
<input type = "text" name = "count_category_to_row" class = "inputbox" id = "count_category_to_row" value = "<?php echo $jshopConfig->count_category_to_row;?>" />
</td>
</tr>
Und im Frontend vereinfacht so:
<div >
<?php if (count($this->categories)){ ?>
<table>
<?php foreach($this->categories as $k=>$category){?>
<?php if ($k%$this->count_category_to_row==0) print "<tr>"; ?>
<td>
<table>
<tr>
<td>
<a href = "<?php echo "..."?><?php print $category->category_link;?>"><img class="jshop_img" src="<?php print $this->image_category_path;?>/<?php if ($category->category_image) print $category->category_image; else print $this->noimage;?>" alt="..." title="..." /></a>
</td>
<td>
<a href = "..."?><?php print $category->category_link?>" title="..." ><?php print $category->name?></a>
<p class = "category_short_description"><?php print $category->short_description?></p>
</td>
</tr>
</table>
</td>
<?php if ($k%$this->count_category_to_row==$this->count_category_to_row-1) print '</tr>'; ?>
<?php } ?>
<?php if ($k%$this->count_category_to_row!=$this->count_category_to_row-1) print '</tr>'; ?>
</table>
<?php }?>
</div>
<?php include(dirname(__FILE__)."/products.php");?>
</div>
Wie kann ich das Skript so verändern, dass praktisch der feste Wet "2" für die Anzahl der Spalten angegeben wird? Schön wäre es natürlich, wenn ich es dann später im Skript leicht auf "3" oder "5" oder wie auch immer anpassen könnte.
Hoffe wirklich auf Hilfe!
Danke, Montimontt
Joomla: 2.5.4
JoomShopping: 3.5.0
JoomShopping: 3.5.0