This is an old revision of the document!


{BREADCRUMB_ARTICLE[:[X]]}

Alternative way of building a breadcrumb.
It will show article title too and act different when in article list mode. (Two explanations, {BREADCRUMB_ARTICLE} and {BREADCRUMB_ARTICLE:[X]} (using start-level)).

{BREADCRUMB_ARTICLE}

{BREADCRUMB_ARTICLE} Output begin in level 0
Home > category_01 > category_01_03 > category_01_03_02 > Article-alias-Cat_01_03_03


rt_breadcrumb_article V1.0 2009/07/11

Docu: –
Forum: http://forum.phpwcms.org/viewtopic.php?p=118076#p118076

Autor: Oliver Georgi http://phpwcms.de
CMS Version: >= 1.4.2 r334
Version: V1.0

Tag: {BREADCRUMB_ARTICLE}

Filename: rt_breadcrumb_article.php

Folder: template/inc_script/frontend_render/

Condition:/config/phpwcms/conf.inc.php

  • $phpwcms['allow_ext_render'] = 1;


rt_breadcrumb_article

<?php
 
/** ----------------------------------------------------------------------------
 * Alternative way of building a breadcrumb
 * It will show article title too and act different when in article list mode
 
 * V1.0
 * 2009/07/11  Oliver Georgi
 *
 * Forum: http://forum.phpwcms.org/viewtopic.php?p=118076#p118076
 * Condition V1.4.2 r334
 *
 * Tag: {BREADCRUMB_ARTICLE}
 -  ---------------------------------------------------------------------------- */
 
if(strpos($content['all'], '{BREADCRUMB_ARTICLE}')) {
 
    $_breadcrumb_spacer            = ' &gt; ';
    $_breadcrumb_link_prefix    = '<b>';
    $_breadcrumb_link_suffix    = '</b>';
    $_breadcrumb_link_attribute    = 'class="breadcrumb-link"';
 
    $_breadcrumb = array();
 
    foreach($LEVEL_ID as $item) {
 
        if($content['struct'][$item]["acat_hidden"] == false) {
            $_breadcrumb[] = 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
                );
        }
 
    }
 
    // Article
    if($aktion[1]) {
 
        $_breadcrumb[] = html_specialchars( $content['article_title'] );
 
    }
 
    $_breadcrumb = implode($_breadcrumb_spacer, array_diff( $_breadcrumb , array('', NULL) ) );
 
    $content['all'] = str_replace('{BREADCRUMB_ARTICLE}', $_breadcrumb, $content['all']);
 
}
 
?>


{BREADCRUMB_ARTICLE:X}

{BREADCRUMB_ARTICLE:[Start-level]}

Enhanced version of the snippet before. You can define a start level, where the output begin.

We don´t mean the ID of a category using the word level, but the number of the gradation of the levels to each other.
Have a look: Basis level and ID.

E.g. with the given structure:

{BREADCRUMB_ARTICLE:0} Output begin in level 0
Home > category_01 > category_01_03 > category_01_03_02 > Article-alias-Cat_01_03_03

{BREADCRUMB_ARTICLE:2} Output begin in level 2
category_01 > category_01_03 > category_01_03_02 > Article-alias-Cat_01_03_03

{BREADCRUMB_ARTICLE:3} Output begin in level 3
category_01_03_02 > Article-alias-Cat_01_03_03


rt_breadcrumb_article_start V1.1 2009/07/11

Docu: –
Forum: http://forum.phpwcms.org/viewtopic.php?p=118076#p118076


Autor: Oliver Georgi http://phpwcms.de
Enhanced by: K.Heermann (flip-flop) http://planmatrix.de
CMS Version: >= 1.4.2 r334
Version: V1.1

Tag: {BREADCRUMB_ARTICLE:[start-level]}

Filename: rt_breadcrumb_article_start.php

Folder: template/inc_script/frontend_render/

Condition:/config/phpwcms/conf.inc.php

  • $phpwcms['allow_ext_render'] = 1;


rt_breadcrumb_article

<?php
/** ----------------------------------------------------------------------------
 * Alternative way of building a breadcrumb
 * It will show article title too and act different when in article list mode
 
 * V1.1 Enhanced version
 * 2009/07/11  Oliver Georgi
 * 2009/07/11  Enhanced by K.Heermann:  Start-level
 *
 * Forum: http://forum.phpwcms.org/viewtopic.php?p=118076#p118076
 * Condition V1.4.2 r334
 *
 * Tag: {BREADCRUMB_ARTICLE:[start-level]}
 -  ---------------------------------------------------------------------------- */
 
// -----------------------------------------------------------------------------
// 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')) {
 
  $content["all"] = str_replace('{BREADCRUMB_ARTICLE}', '{BREADCRUMB_ARTICLE:0}', $content["all"]);
 
  preg_match_all ('/\{BREADCRUMB_ARTICLE:(\d+)\}/e', $content["all"], $matches);
 
 
  $_breadcrumb_spacer     = ' &gt; ';
//  $_breadcrumb_spacer     = $template_default["breadcrumb_spacer"];
  $_breadcrumb_link_prefix  = '<b>';
  $_breadcrumb_link_suffix  = '</b>';
  $_breadcrumb_link_attribute = 'class="breadcrumb-link"';
 
 
  // $matches[1][X] = startlevel of {BREADCRUMB:[X]}
  // $matches[1][0,1,2,3...] = Count of {BREADCRUMB:[X]} tags
 
  foreach ($matches[1] as $key_start => $item_start) {  // More than one breadcrumb tags?
 
    $_breadcrumb = array();
 
    foreach($LEVEL_ID as $key => $item) {
 
      if( ($content['struct'][$item]["acat_hidden"] == false) AND ($matches[1][$key_start] <= $key) ) { // start level <= level
        $_breadcrumb[] = getStructureLevelLink(
// Two output versions. Enable/disable the two following lines and vice versa
// ---- all categories have a link tag besides at article listing
//            ($content['cat_id'] == $item && $content['list_mode']) ? $content['struct'][$item]['acat_name'] : $content['struct'][$item],
// ----
// ==== All categories have a link tag at all
            $content['struct'][$item],
// ====
            $_breadcrumb_link_attribute,
            $_breadcrumb_link_prefix,
            $_breadcrumb_link_suffix
        );
      }
    }
 
// Article: if there is a category set
    if($aktion[1] AND !empty($_breadcrumb)) {
 
      $_breadcrumb[] = html_specialchars( $content['article_title'] );
 
    }
 
   $_breadcrumb = implode($_breadcrumb_spacer, array_diff( $_breadcrumb , array('', NULL) ) );
 
 
    $content["all"] = preg_replace('/\{BREADCRUMB_ARTICLE\:'.$matches[1][$key_start].'\}/', $_breadcrumb, $content["all"]);
 
  }
}
 
?>
english/phpwcms_replacer_rts/frontend_render/breadcrumb-article.1247385406.txt.gz · Last modified: 2018/06/03 18:08 (external edit)
www.planmatrix.de www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0