You can hardcode some structur_level_ids (<- hope you understand that) and it gives you an image on every page that is below that id.
I needed it for custom header images in different page_sublevels and did not want to do it with templates. Its hardcoded for now, but if someone wants to change it to variables I would be happy, maybe I will do it myself some time, but for now it does what I need.
Code: Select all
<?php
// REPLACEMENT TAG {SHOW_CAT_IMAGE}
$cur_toplevel_name = '';
$GLOBALS['nav_point_listing'] = get_breadcrumb($GLOBALS['content']["cat_id"], $GLOBALS['content']['struct']);
$imageoutput = '';
if(isset($GLOBALS['nav_point_listing']) && count($GLOBALS['nav_point_listing']) > 1) {
reset($GLOBALS['nav_point_listing']);
next($GLOBALS['nav_point_listing']);
$cur_toplevel_id = html_specialchars($GLOBALS['content']['struct'][ intval(key($GLOBALS['nav_point_listing'])) ]['acat_id']);
}
switch($cur_toplevel_id) {
case 1: $imageoutput = '<img src="img/header/1.jpg" alt="" border="0">'; break;
case 10: $imageoutput = '<img src="img/header/2.jpg" alt="" border="0">'; break;
case 17: $imageoutput = '<img src="img/header/3.jpg" alt="" border="0">'; break;
default: $imageoutput = '<img src="img/header/1.jpg" alt="" border="0">';
}
$content['all'] = str_replace('{SHOW_CAT_IMAGE}', $imageoutput, $content['all']);
?>
\phpwcms_template\inc_script\frontend_render\
[/quote]