1283 Posts
Bucklash
8 years ago
Topic

Hi folks

I have created an override for the Seblod Breadcrumbs module... any opinions, suggestions? Thanks
For 'Separator' in the modules settings I have added: 'separator fa fa-chevron-circle-right'

The php file is like this

<?php
/**
* @version 			SEBLOD 3.x Core
* @package			SEBLOD (App Builder & CCK) // SEBLOD nano (Form Builder)
* @url				http://www.seblod.com
* @editor			Octopoos - www.octopoos.com
* @copyright		Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license 			GNU General Public License version 2 or later; see _LICENSE.php
**/
defined( '_JEXEC' ) or die;
?>
<div class="cck_module_breadcrumbs <?php echo $class_sfx; ?>">
	<ul class="list-inline" itemscope itemtype="http://schema.org/BreadcrumbList">
	<?php
	$show_last	=	$params->get( 'showLast', 1 );
	if ( $params->get( 'showHere', 1 ) ) {
			echo '<span class="showHere">'.JText::_( 'MOD_CCK_BREADCRUMBS_HERE' ).'</span>';
	}
	for ( $i = 0; $i < $count; $i++ ) {
		echo '<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">';
		if ( $i < $count -1 ) { // If not the last item in the breadcrumbs add the separator
			if ( !empty($list[$i]->link ) ) {
				echo '<a itemscope itemtype="http://schema.org/Thing"
       itemprop="item" href="'.$list[$i]->link.'" class="pathway"><span itemprop="name">'.$list[$i]->name.'</span></a>';
			} else {
				echo '<span itemscope itemtype="http://schema.org/Thing" itemprop="item" class="pathway"><span itemprop="name">'.$list[$i]->name.'</span></span>';
			}
			echo '<meta itemprop="position" content="'.($i+1).'" />';
			echo '<span class="'.$separator_class.' ">'.$separator.'</span>';
			// if( $i < $count -2 ) {
			// }
		} elseif ( $show_last ) { // when $i == $count -1 and 'showLast' is true
			// if ( $i > 0 ) {
			// 	echo '<span class=" '.$separator_class.'">'.$separator.'</span>';
			// }
			echo '<span itemscope itemtype="http://schema.org/Thing" itemprop="item" class="pathway-last"><span itemprop="name">'.$list[$i]->name.'</span></span>';
		}
		echo '</li><wbr>';
	}
	?>
	</ul>
</div>

          

The output is like this: 

<div class="cck_module_breadcrumbs ">
    <ul class="list-inline" itemscope="" itemtype="http://schema.org/BreadcrumbList">
        <span class="showHere">You are here: </span><br>        <li itemprop="itemListElement" itemscope="" itemtype="http://schema.org/ListItem">
            <a itemscope="" itemtype="http://schema.org/Thing" itemprop="item" href="/" class="pathway">
                <span itemprop="name">Home</span>
            </a>
            <meta itemprop="position" content="1">
            <span class="separator fa fa-chevron-circle-right  "> </span>
        </li><wbr>
        <li itemprop="itemListElement" itemscope="" itemtype="http://schema.org/ListItem">
            <a itemscope="" itemtype="http://schema.org/Thing" itemprop="item" href="/lesson-files?search=lesson_files_list&task=search" class="pathway">
                <span itemprop="name">Lesson Files</span>
            </a>
            <meta itemprop="position" content="2">
            <span class="separator fa fa-chevron-circle-right  "> </span>
         </li><wbr>
         <li itemprop="itemListElement" itemscope="" itemtype="http://schema.org/ListItem">
             <span itemscope="" itemtype="http://schema.org/Thing" itemprop="item" class="pathway-last">
                 <span itemprop="name">Harmonics 12-7-5 Fret</span>
             </span>
         </li><wbr>
      </ul>
</div>
<br>
Get a Book for SEBLOD
4229 Posts
Kadministrator
8 years ago
3
Level 1

Hi,

In my opinion this would be nice to have in core, so I would suggest that you make a pull request for this to be included  as alternative (or main.. ) layout

1283 Posts
Bucklash
8 years ago
2
Level 2

Hi Klas

Seeing as you is THE guru around here I better had do it... 

Pull Request:

Microdata layout for Breadcrumb module

   

Bucklash

8 years ago
1
Level 3

good job mate. will copy this over and see how it goes. Thanks again. you are doing a great job in this forum. 

1283 Posts
Bucklash
8 years ago
0
Level 4

Hi codekadiya

Get the stuff from github

Klas recommended alrerations which I have implemented

572 Posts
_jrmo
8 years ago
0
Level 1

Just wanted to say THANKS for this! :) very helpful.

Get a VIP membership