Re: {BREADCRUMB} vs. gegenwärtige position in der seite
Posted: Wed 5. Dec 2012, 18:59
Nein ich meine ja die Variante die hier schon verlinkt ist, kann also ruhig ins frontend_render VZ 
The phpwcms support forum will help to find answers to your questions. The small but strong community is here since more than 10 years.
https://forum.phpwcms.org/
Code: Select all
$content['struct'][$item]['acat_name']Code: Select all
<?php
/** ----------------------------------------------------------------------------
* Alternative way of building a breadcrumb
* It will show article title too and act different when in article list mode
* This works different from default breadcrumb because it is level based
*
* (c) 2012 Oliver Georgi
*
* V1.1
* V2.0 5.12.2012: Enhanced by enym.com
* - now creates an ul with "current" class in current level
* - adds article subtitle as well (only if there is one)
* - adds news-title and subtitle to breadcrump-list if in newsdetail mode
*
* Forum: http://forum.phpwcms.org/viewtopic.php?p=118076#p118076
* Condition V1.4.2 r334
*
* Tag: {BREADCRUMB_ARTICLE}
* ---------------------------------------------------------------------------- */
// -----------------------------------------------------------------------------
// OBLIGATE CHECK FOR PHPWCMS CONSTANTS
if (!defined('PHPWCMS_ROOT')) {die("You Cannot Access This Script Directly, Have a Nice Day.");}
// -----------------------------------------------------------------------------
if(strpos($content['all'], '{BREADCRUMB_ARTICLE}')) {
// Set level where to start with breadcrumb - default 0 = Root level
$_breadcrumb_start_level = 0;
// Separate Breadcrumb items with
$_breadcrumb_spacer = '';
// Wrap inner link text by prefix/suffix <a> %PREFIX% Linktext %SUFFIX% </a>
$_breadcrumb_link_prefix = '';
$_breadcrumb_link_suffix = '';
// additional link attributes like class, rel, style
// remember there is no active link - active (last) item has no link
$_breadcrumb_link_attribute = 'class="breadcrumb-link"';
////// Do not edit below ////////
$_breadcrumb = array();
if(count($LEVEL_ID) > $_breadcrumb_start_level) {
foreach($LEVEL_ID as $level => $item) {
if($level < $_breadcrumb_start_level) {
continue;
}
if($content['struct'][$item]["acat_hidden"] == false) {
$_breadcrumb[] = "<li>".
getStructureLevelLink(
($content['cat_id'] == $item && $content['list_mode']) ? $content['struct'][$item]['acat_name'] : $content['struct'][$item],
$_breadcrumb_link_attribute,
$_breadcrumb_link_prefix,
$_breadcrumb_link_suffix
)."</li>";
}
}
}
// If Articledetail
if($aktion[1]) {
if ($content['articles'][$aktion[1]]['article_subtitle'] != '') {
$adder = ' - ';
}
if(!isset($_getVar['newsdetail'])) {
//current article is current level if u r not in newsdetail
$current = ' class="current"';
}
if(isset($_getVar['newsdetail'])) {
//if u r in newsdetail container article needs a link
if ($phpwcms['rewrite_ext'] != "" && $phpwcms['rewrite_url']) {
$link = $content['articles'][$aktion[1]]['article_alias'].$phpwcms['rewrite_ext'];
} else {
$link = "index.php?".$content['articles'][$aktion[1]]['article_alias'];
}
} else {
$link = "#";
}
//$_breadcrumb[] = '<li><a href"#">'.html_specialchars( $content['article_title'] ).' - '.html_specialchars( $content['article_subtitle'] ).'</a></li>';
$_breadcrumb[] = '<li><a href="'.$link.'"'.$current.'>'.html_specialchars( $content['article_title'] ).$adder. html_specialchars( $content['articles'][$aktion[1]]['article_subtitle'] ) .'</a></li>';
}
// If Newsdetail
if(isset($_getVar['newsdetail'])) {
if ($news['result'][0]['cnt_subtitle'] != '') {
$adder = ' - ';
}
$_breadcrumb[] = '<li><a href"#" class="current">'.html_specialchars( $news['result'][0]['cnt_title'] ).$adder. html_specialchars( $news['result'][0]['cnt_subtitle'] ) .'</a></li>';
}
$_breadcrumb = implode($_breadcrumb_spacer, array_diff( $_breadcrumb , array('', NULL) ) );
$content['all'] = str_replace('{BREADCRUMB_ARTICLE}', '<ul>'.$_breadcrumb.'</ul>', $content['all']);
}
?>