Wie man verschiedene Templates für Kategorien verwendet hat Jan schon bestens in seinem Mod beschrieben
:
http://www.4homepages.de/forum/viewtopic.php?t=1847Mir war es wichtig die
thumbnail_bit Datei in verschiedenen Kategorien anders darzustellen und habe das Mod erweitert:
This mod allows you to use different thumbnail templates. Templates will be inherited on subcategories.
----
Diese Modifikation erlaubt es, verschiedene Thumbnail-Templates für Kategorien zu verwenden. Dabei wird ein Template auf seine Unterkategorien vererbt.
Installation:
1. Open "includes/functions.php" and add after:
Code:
if (!defined('ROOT_PATH')) {
die("Security violation");
}
this code:
Code:
function get_cat_template($tpl_name, $cat_id = 0) {
global $cat_cache;
if (!$cat_id) {
$new_tpl_name = $tpl_name;
}
elseif (file_exists(TEMPLATE_PATH."/".$tpl_name."_".$cat_id.".html")) {
$new_tpl_name = $tpl_name."_".$cat_id;
}
else {
$new_tpl_name = get_cat_template($tpl_name, $cat_cache[$cat_id]['cat_parent_id']);
}
return $new_tpl_name;
}
2. Search in "categories.php" :
$main_template = 'categories';
and insert below:
$thumb_art= 'thumbnail_bit';
3. Open "categories.php" and replace:
$thumbnails .= $site_template->parse_template("thumbnail_bit");
with this code:
Code:
$thumbnails_neu= get_cat_template($thumb_art, $cat_id);
$thumbnails .= $site_template->parse_template($thumbnails_neu);
4. Create a new thumbnail-template for a specific category (you may duplicate "thumbnail_bit" and modify it) and save it under this name:
Code:
thumbnail_bit_<cat_id>.html
Replace <cat_id> with id of the category.
This category and all subcategories will now use this template.
Hoffe ich habe nichts vergessen. Bitte um kurzes Feetback.
By the way: wirklich gutes script.0711concept