VirtueMart Forum

VirtueMart 2 + 3 + 4 => Security (https) / Performance / SEO, SEF, URLs => Topic started by: -Tony- on June 09, 2015, 12:56:58 PM

Title: Breadcrumbs links not SEF
Post by: -Tony- on June 09, 2015, 12:56:58 PM
Hello
Joomla 3.4.1
Virtuemart 3.0.9
SEF url enabled
Since I made the migration, i notice a problem with virtuemart links on breadcrumbs i had not noticed on older versions. I am seen me when i wanted to do an override of mod_breadcrumbs to add microdatas.
(Breadcrumbs for Joomla links works perfectly)
The problem :

*For Virtuemart home page :

url SEF : www.mydomain.com/name-of-virtuemart-home-page

url of breadcrumb : www.mydomain.com/name-of-virtuemart-home-page?productsublayout=0

*For category pages :

url SEF : www.mydomain.com/name-of-virtuemart-home-page/name-of-category-page

url of breadcrumb : www.mydomain.com/name-of-virtuemart-home-page/name-of-category-page/manufacturer/?categorylayout=0&showcategory=1&showproducts=1&productsublayout=0

*For Productdetails pages :

url SEF : www.mydomain.com/name-of-virtuemart-home-page/name-of-category-page/name-of-my-product

url of breadcrumb : www.mydomain.com

I guess the source of all this is in the router.php of virtuemart or/and view.html.php of category/productdetails/virtuemart... I've looked but I did not quite good in php to accurately locate lines in question ...

I thought of a temporary solution that will be in mod_breadcrumbs not to call the url with href = "'. $ Item-> link." Virtuemart since air having problems with the interpretation of itemid, but with aliases, except for the syntax I do not see ...

Thanks
Title: Re: Breadcrumbs links not SEF
Post by: -Tony- on June 15, 2015, 00:32:21 AM
I tried various things but it did not work, following the example of the mod_menu.
Virtuemart url called by mod_menu are ok and not those of mod_breadcrumbs and I can't do the same...
Title: Re: Breadcrumbs links not SEF
Post by: -Tony- on June 16, 2015, 11:13:54 AM
Maybe I did not give enough information, sorry if.
But I thought the explanation of my first message was quite clear.
Template homemade/customized, based on Horme template I was using before.
Overrides to defuse calls of functions and combine them with libraries into a single script and deferred.
Overrides html for the layout.
Link : http://www.brundubonsai.fr/ (http://www.brundubonsai.fr/)
Title: Re: Breadcrumbs links not SEF
Post by: franzpeter on June 16, 2015, 15:36:08 PM
Did you manually insert the virtuemart homepage link or did you link the shop (virtuemart page) in the default way: adding menu item with Joomla, name it for example shop and choose Virtuemart Standard page or so?
Title: Re: Breadcrumbs links not SEF
Post by: franzpeter on June 16, 2015, 15:47:05 PM
Sorry, now I understand what was meant. You do a normal navigation (not the breadcrumb navigation) for example to a product and it shows www.mydomain.com/name-of-virtuemart-home-page/name-of-category-page/name-of-my-product. If you use the breadcrumb link to navigate back to www.mydomain.com/name-of-virtuemart-home-page it shows: www.mydomain.com/name-of-virtuemart-home-page?productsublayout=0.
Yes I can confirm that behaviour.

I think at the moment the quickest solution is to not show the breadcrumb navigation with name-of-virtuemart-home-page means to not show the breadcrumb module and use the VM navigation instead.
Title: Re: Breadcrumbs links not SEF
Post by: -Tony- on June 16, 2015, 15:54:52 PM
Hi
Thanks for your reply
i remember I do like this:
in: menu management
new
Type menu link
selected: Homepage virtuemart
and for category selected category virtuemart, and parent is homepage virtuemart.
It's the good way ?
Title: Re: Breadcrumbs links not SEF
Post by: -Tony- on June 16, 2015, 16:13:18 PM
Ok, disable the breadcrumbs on category and product page and waiting for a fix.

So i think I'll try to keep only the name and remove the link to productdetails, category and virtuemart view.

Like this :

<ul class="breadcrumbs<?php echo $moduleclass_sfx?>">
<?php if ($params->get('showHere'1))
{
echo '<li itemprop="breadcrumb" class="active">' JText::_('MOD_BREADCRUMBS_HERE') . '</li>';
}

// Get rid of duplicated entries on trail including home page when using multilanguage
for ($i 0$i $count$i++)
{
if ($i == && !empty($list[$i]->link) && !empty($list[$i 1]->link) && $list[$i]->link == $list[$i 1]->link)
{
unset($list[$i]);
}
}

// Find last and penultimate items in breadcrumbs list
end($list);
$last_item_key key($list);
prev($list);
$penult_item_key key($list);
// Make a link if not the last item in the breadcrumbs
$show_last $params->get('showLast'1);
// Generate the trail
$view JRequest::getCmd('view');
foreach ($list as $key => $item) :
if (
$view != 'virtuemart') || ($view != 'category') || ($view != 'productdetails') {
if ($key != $last_item_key)
{
// Render all but last item - along with separator
echo '<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb">';
if (!empty($item->link))
{
echo '<a itemprop="url" href="' $item->link '" class="pathway"><span itemprop="title">' $item->name '</span></a>';
}
else
{
echo '<span>' $item->name '</span>';
}

echo '</li>';
}
elseif ($show_last)
{
// Render last item if reqd.
echo '<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="active">';
echo '<a itemprop="url" href="' $item->link '" class="pathway"><span itemprop="title">' $item->name '</span></a>';
echo '</li>';
}
}
if (
$view == 'virtuemart') || ($view == 'category') || ($view == 'productdetails') {
if ($key != $last_item_key)
{
// Render all but last item - along with separator
echo '<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb">';
if (!empty($item->link))
{
echo '<span itemprop="title">' $item->name '</span></a>';
}
else
{
echo '<span>' $item->name '</span>';
}

echo '</li>';
}
elseif ($show_last)
{
// Render last item if reqd.
echo '<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="active">';
echo '<span itemprop="title">' $item->name '</span></a>';
echo '</li>';
}
}
endforeach; ?>

</ul>


i think it will work
Title: Re: Breadcrumbs links not SEF
Post by: Studio 42 on June 17, 2015, 01:07:27 AM
HI,
It's strange, i don't have any problems in breadcrumb, it's always clear. Perhaps it's when you set a layout in VM?
More strange you have "fournisseur" in the link. as if the view was filtered by "manufacturer" ?!?

Greets,
Patrick

P.S:Site sympa au passage, j'adore les bonsaï, mais j'ai pas la patiente  ;)
Title: Re: Breadcrumbs links not SEF
Post by: franzpeter on June 17, 2015, 10:18:52 AM
@Studio 42: I have those problems too if switching on the breadcrumb module. There is no problem as long as you do not use the breadcrumbs for navigation. It is more a cosmetical problem, because the canonical url is always well created, only the url makes problems. It is as soon as you navigate with the breadcrumb links.
Title: Re: Breadcrumbs links not SEF
Post by: -Tony- on June 17, 2015, 10:28:21 AM
Hi Patrick
Thanks for your reply

In the menu configuration, all category and home page was on no override, so after your reply i've selected "default" for default.php i imagine (my layout override for category views), but no changes, just in the path ?categorylayout=0 change to ?categorylayout=default
and for home page but for sublayouts, the choice is no overrided or product_horizon, but i've no overrided product_horizon.php, sublayouts i've overrided is askrecomjs.php and products.php...

For "manufacturer", yeah...that's also strange, i've no manufacturer because manufacturer it's me and so in virtuemart configuration manufacturer was empty (manufacturer=0).
I had a issue because of that.
For example, for canonical link in category view, added"manufacturer" in the pathway, so i've apply a fix found on this forum :


//changed this

$link = 'index.php?option=com_virtuemart&view=category';
if($categoryId!==-1){
$link .= '&virtuemart_category_id='.$categoryId;
}
if($manId!==-1){
$link .= '&virtuemart_manufacturer_id='.$manId;
}

$document->addHeadLink( JRoute::_($link, FALSE) , 'canonical', 'rel', '' );

//by this

$link = 'index.php?option=com_virtuemart&view=category';
if($categoryId!==-1){
$link .= '&virtuemart_category_id='.$categoryId;
}
if($manId!==-1 && $manId >=1){
$link .= '&virtuemart_manufacturer_id='.$manId;
}

$document->addHeadLink(JRoute::_($link, FALSE) , 'canonical', 'rel', '' );


Perhaps it's the same way for the pathway somewhere in a file?



Merci Patrick, Le bonsai c'est vraiment cool, et justement un rapport au temps un peu paradoxal avec la société actuelle ;)
Title: Re: Breadcrumbs links not SEF
Post by: -Tony- on June 17, 2015, 10:58:37 AM
Quote from: franzpeter on June 17, 2015, 10:18:52 AM
@Studio 42: I have those problems too if switching on the breadcrumb module. There is no problem as long as you do not use the breadcrumbs for navigation. It is more a cosmetical problem, because the canonical url is always well created, only the url makes problems. It is as soon as you navigate with the breadcrumb links.

Hi
I think when you added microdatas on breadcrumbs it's more important, url considered for rich snippet breadcrumbs must be the canonical url for good seo.
Title: Re: Breadcrumbs links not SEF
Post by: Miku on June 17, 2015, 15:25:00 PM
Seems to be related with this thread:
http://forum.virtuemart.net/index.php?topic=130239.0
http://forum.virtuemart.net/index.php?topic=130133.0
Title: Re: Breadcrumbs links not SEF
Post by: PRO on June 17, 2015, 16:49:03 PM
mod_breadcrumbs/tmpl/default.php

I added this
$item->link=str_replace( 'manufacturer/?categorylayout=0&amp;showcategory=1&amp;showproducts=1&amp;productsublayout=0', '', $item->link);


// Render all but last item - along with separator
      echo '<li>';
      if (!empty($item->link))
      {  $item->link=str_replace( 'manufacturer/?categorylayout=0&amp;showcategory=1&amp;showproducts=1&amp;productsublayout=0', '', $item->link);
         echo '<a href="' . $item->link . '" class="pathway">' . $item->name . '</a>';
      }
Title: Re: Breadcrumbs links not SEF
Post by: -Tony- on June 17, 2015, 17:38:51 PM
Yeaah ! thank you very much !

So i do this :


$item->link=str_replace( 'fournisseur/?categorylayout=default&amp;showcategory=1&amp;showproducts=1&amp;productsublayout=0', '', $item->link);
$item->link=str_replace( '?productsublayout=0', '', $item->link);


And it works
Exept the last item in productdetails view, productdetails have no pathway

So i do this :


elseif ($show_last)
{$monUrl = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
// Render last item if reqd.
echo '<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="active">';
echo '<a itemprop="url" href="' . $monUrl . '" class="pathway"><span itemprop="title">' . $item->name . '</span></a>';
echo '</li>';
}


And it works

happy end, thank you all.
Title: Re: Breadcrumbs links not SEF
Post by: vinhbui2488 on July 29, 2015, 17:08:24 PM
Quote from: PRO on June 17, 2015, 16:49:03 PM
mod_breadcrumbs/tmpl/default.php

I added this
$item->link=str_replace( 'manufacturer/?categorylayout=0&amp;showcategory=1&amp;showproducts=1&amp;productsublayout=0', '', $item->link);


// Render all but last item - along with separator
      echo '<li>';
      if (!empty($item->link))
      {  $item->link=str_replace( 'manufacturer/?categorylayout=0&amp;showcategory=1&amp;showproducts=1&amp;productsublayout=0', '', $item->link);
         echo '<a href="' . $item->link . '" class="pathway">' . $item->name . '</a>';
      }

Why I can do it ??
My code :

<?php
/**
 * @package     Joomla.Site
 * @subpackage  mod_breadcrumbs
 *
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

JHtml::_('bootstrap.tooltip');

?>


<ul class="breadcrumb<?php echo $moduleclass_sfx?>">
<?php
if (
$params->get('showHere'1))
{
echo '<li class="active">' JText::_('MOD_BREADCRUMBS_HERE') . '&#38;#160;</li>';
}
else
{
echo '<li class="active"><span class="divider icon-location"></span></li>';
}

// Get rid of duplicated entries on trail including home page when using multilanguage
for ($i 0$i $count$i++)
{
if ($i == && !empty($list[$i]->link) && !empty($list[$i 1]->link) && $list[$i]->link == $list[$i 1]->link)
{
unset($list[$i]);
}
}

// Find last and penultimate items in breadcrumbs list
end($list);
$last_item_key key($list);
prev($list);
$penult_item_key key($list);

// Make a link if not the last item in the breadcrumbs
$show_last $params->get('showLast'1);

// Generate the trail
foreach ($list as $key => $item) :
if ($key != $last_item_key)
{
// Render all but last item - along with separator
echo '<li>';
if (!empty($item->link))
{
echo '<a href="' $item->link '" class="pathway">' $item->name '</a>';
}
else
{
echo '<span>' $item->name '</span>';
}

if (($key != $penult_item_key) || $show_last)
{
echo '<span class="divider">' $separator '</span>';
}

echo '</li>';
}
elseif ($show_last)
{
// Render last item if reqd.
echo '<li class="active">';
echo '<span>' $item->name '</span>';
echo '</li>';
}
endforeach; ?>

</ul>


My site:
eshop4vn.com
Title: Re: Breadcrumbs links not SEF
Post by: Studio 42 on July 29, 2015, 21:05:19 PM
for vinhbui2488
after :
if ($key != $last_item_key)
{
Title: Re: Breadcrumbs links not SEF
Post by: vinhbui2488 on July 30, 2015, 11:37:05 AM
Quote from: Studio 42 on July 29, 2015, 21:05:19 PM
for vinhbui2488
after :
if ($key != $last_item_key)
{


i change but not ok.
what can i do ??
Quote
if ($key != $last_item_key)
   {
$item->link=str_replace( 'fournisseur/?categorylayout=default&amp;showcategory=1&amp;showproducts=1&amp;productsublayout=0', '', $item->link);
      // Render all but last item - along with separator
      echo '<li>';
      if (!empty($item->link))
      {
         echo '<a href="' . $item->link . '" class="pathway">' . $item->name . '</a>';
      }
      else
      {
         echo '<span>' . $item->name . '</span>';
      }

      if (($key != $penult_item_key) || $show_last)
      {
         echo '<span class="divider">' . $separator . '</span>';
      }

      echo '</li>';
   }
Title: Re: Breadcrumbs links not SEF
Post by: PRO on July 30, 2015, 12:06:25 PM
what?
Title: Re: Breadcrumbs links not SEF
Post by: Studio 42 on July 30, 2015, 20:11:39 PM
i think this part is bad :  'fournisseur/?categorylayout=default&amp;showcategory=1&amp;showproducts=1&amp;productsublayout=0'.
Change it that is suit in your site.
Title: Re: Breadcrumbs links not SEF
Post by: vinhbui2488 on August 30, 2015, 18:46:26 PM
Quote from: Studio 42 on July 30, 2015, 20:11:39 PM
i think this part is bad :  'fournisseur/?categorylayout=default&amp;showcategory=1&amp;showproducts=1&amp;productsublayout=0'.
Change it that is suit in your site.

Thank you so much.
But i can't fix.

if ($key != $last_item_key)
{
$item->link=str_replace('manufacturer/?categorylayout=0&amp;showcategory=1&amp;showproducts=1&amp;productsublayout=0', '', $item->link);


// Render all but last item - along with separator
      echo '<li>';
      if (!empty($item->link))
      {  $item->link=str_replace('manufacturer/?categorylayout=0&amp;showcategory=1&amp;showproducts=1&amp;productsublayout=0', '', $item->link);
         echo '<a href="' . $item->link . '" class="pathway">' . $item->name . '</a>';
      }
Title: Re: Breadcrumbs links not SEF
Post by: PRO on August 30, 2015, 22:11:02 PM
Quote from: vinhbui2488 on July 29, 2015, 17:08:24 PM
Quote from: PRO on June 17, 2015, 16:49:03 PM
mod_breadcrumbs/tmpl/default.php

I added this
$item->link=str_replace( 'manufacturer/?categorylayout=0&amp;showcategory=1&amp;showproducts=1&amp;productsublayout=0', '', $item->link);


// Render all but last item - along with separator
      echo '<li>';
      if (!empty($item->link))
      {  $item->link=str_replace( 'manufacturer/?categorylayout=0&amp;showcategory=1&amp;showproducts=1&amp;productsublayout=0', '', $item->link);
         echo '<a href="' . $item->link . '" class="pathway">' . $item->name . '</a>';
      }

Why I can do it ??
My code :

<?php
/**
 * @package     Joomla.Site
 * @subpackage  mod_breadcrumbs
 *
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

JHtml::_('bootstrap.tooltip');

?>


<ul class="breadcrumb<?php echo $moduleclass_sfx?>">
<?php
if (
$params->get('showHere'1))
{
echo '<li class="active">' JText::_('MOD_BREADCRUMBS_HERE') . '&#160;</li>';
}
else
{
echo '<li class="active"><span class="divider icon-location"></span></li>';
}

// Get rid of duplicated entries on trail including home page when using multilanguage
for ($i 0$i $count$i++)
{
if ($i == && !empty($list[$i]->link) && !empty($list[$i 1]->link) && $list[$i]->link == $list[$i 1]->link)
{
unset($list[$i]);
}
}

// Find last and penultimate items in breadcrumbs list
end($list);
$last_item_key key($list);
prev($list);
$penult_item_key key($list);

// Make a link if not the last item in the breadcrumbs
$show_last $params->get('showLast'1);

// Generate the trail
foreach ($list as $key => $item) :
if ($key != $last_item_key)
{
// Render all but last item - along with separator
echo '<li>';
if (!empty($item->link))
{
echo '<a href="' $item->link '" class="pathway">' $item->name '</a>';
}
else
{
echo '<span>' $item->name '</span>';
}

if (($key != $penult_item_key) || $show_last)
{
echo '<span class="divider">' $separator '</span>';
}

echo '</li>';
}
elseif ($show_last)
{
// Render last item if reqd.
echo '<li class="active">';
echo '<span>' $item->name '</span>';
echo '</li>';
}
endforeach; ?>

</ul>


My site:
eshop4vn.com



<?php
/**
* @package     Joomla.Site
* @subpackage  mod_breadcrumbs
*
* @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
* @license     GNU General Public License version 2 or later; see LICENSE.txt
*/

defined('_JEXEC') or die;

JHtml::_('bootstrap.tooltip');

?>

<ul class="breadcrumb<?php echo $moduleclass_sfx; ?>">
   <?php
   if ($params->get('showHere', 1))
   {
      echo '<li class="active">' . JText::_('MOD_BREADCRUMBS_HERE') . '&#160;</li>';
   }
   else
   {
      echo '<li class="active"><span class="divider icon-location"></span></li>';
   }

   // Get rid of duplicated entries on trail including home page when using multilanguage
   for ($i = 0; $i < $count; $i++)
   {
      if ($i == 1 && !empty($list[$i]->link) && !empty($list[$i - 1]->link) && $list[$i]->link == $list[$i - 1]->link)
      {
         unset($list[$i]);
      }
   }

   // Find last and penultimate items in breadcrumbs list
   end($list);
   $last_item_key = key($list);
   prev($list);
   $penult_item_key = key($list);

   // Make a link if not the last item in the breadcrumbs
   $show_last = $params->get('showLast', 1);

   // Generate the trail
   foreach ($list as $key => $item) :
   if ($key != $last_item_key)
   {
      // Render all but last item - along with separator
      echo '<li>';
      if (!empty($item->link))
      {
      $item->link=str_replace( 'manufacturer/?categorylayout=0&amp;showcategory=1&amp;showproducts=1&amp;productsublayout=0', '', $item->link);
         echo '<a href="' . $item->link . '" class="pathway">' . $item->name . '</a>';
      }
      else
      {
         echo '<span>' . $item->name . '</span>';
      }

      if (($key != $penult_item_key) || $show_last)
      {
         echo '<span class="divider">' . $separator . '</span>';
      }

      echo '</li>';
   }
   elseif ($show_last)
   {
      // Render last item if reqd.
      echo '<li class="active">';
      echo '<span>' . $item->name . '</span>';
      echo '</li>';
   }
   endforeach; ?>
</ul>

Title: Re: Breadcrumbs links not SEF
Post by: Studio 42 on August 31, 2015, 16:15:06 PM
This part sould be removed by the virtuemart router :
?categorylayout=default&amp;showcategory=1&amp;showproducts=1&amp;productsublayout=0'.
this was intruduced in VM3, but rrouter don't check for this because noone have changed the code to remove it when you have default values. Tho code as add with get method and all url query is added in the URL(this is needed when you want to add parameters eg. for search).
I already give some type to dev team to solve some error, but no answer or change from team. I update some missing code for my customer, but this is not a long term solution. Hope a day a dev give some time to update the router code.
Title: Re: Breadcrumbs links not SEF
Post by: vinhbui2488 on August 31, 2015, 16:38:00 PM
@Studio 42 & PRO
Thank you so much  :D
Title: Re: Breadcrumbs links not SEF
Post by: darken-ua on September 01, 2015, 17:55:35 PM
I change the code in joomla breadcrumbs module nothing happens. Only when I created a category breadcrumbs in ../templates/my_template/html/ the template URL has changed, but without the .html suffix. How to add a .html suffix to the end of URL addresses?

When the problem with the navigator in the router of Virtuemart? This problem is not the first month!
Title: Re: Breadcrumbs links not SEF
Post by: Studio 42 on September 01, 2015, 21:38:16 PM
YOu don't need .html suffix, all browser, serach engines do not check anymore for html at end.
And you have another advantage, a link is always valid on removing last path part.
eg. home.com/category/product-details >home.com/category > home.com
Title: Re: Breadcrumbs links not SEF
Post by: Sheepiss on January 30, 2016, 20:00:58 PM
Hello,

what and where should I add please, when the code seems like this:
<?php
/**
 * @package     Joomla.Site
 * @subpackage  mod_breadcrumbs
 *
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

JHtml::_('bootstrap.tooltip');
?>


<ul itemscope itemtype="http://schema.org/BreadcrumbList" class="breadcrumb<?php echo $moduleclass_sfx?>">
<?php if ($params->get('showHere'1)) : ?>
<li class="active">
<?php echo JText::_('MOD_BREADCRUMBS_HERE'); ?>&#160;
</li>
<?php else : ?>
<li class="active">
<span class="divider icon-location"></span>
</li>
<?php endif; ?>

<?php
// Get rid of duplicated entries on trail including home page when using multilanguage
for ($i 0$i $count$i++)
{
if ($i == && !empty($list[$i]->link) && !empty($list[$i 1]->link) && $list[$i]->link == $list[$i 1]->link)
{
unset($list[$i]);
}
}

// Find last and penultimate items in breadcrumbs list
end($list);
$last_item_key key($list);
prev($list);
$penult_item_key key($list);

// Make a link if not the last item in the breadcrumbs
$show_last $params->get('showLast'1);

// Generate the trail
foreach ($list as $key => $item) :
if ($key != $last_item_key) :
// Render all but last item - along with separator ?>

<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<?php if (!empty($item->link)) : ?>
<a itemprop="item" href="<?php echo $item->link?>" class="pathway">
<span itemprop="name">
<?php echo $item->name?>
</span>
</a>
<?php else : ?>
<span itemprop="name">
<?php $item->name?>
</span>
<?php endif; ?>

<?php if (($key != $penult_item_key) || $show_last) : ?>
<span class="divider">
<?php echo $separator?>
</span>
<?php endif; ?>
<meta itemprop="position" content="<?php echo $key 1?>">
</li>
<?php elseif ($show_last) :
// Render last item if reqd. ?>

<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem" class="active">
<span itemprop="name">
<?php echo $item->name?>
</span>
<meta itemprop="position" content="<?php echo $key 1?>">
</li>
<?php endif;
endforeach; ?>

</ul>
Title: Re: Breadcrumbs links not SEF
Post by: razor7 on June 03, 2016, 15:43:17 PM
Quote from: -Tony- on June 17, 2015, 17:38:51 PM
Yeaah ! thank you very much !

So i do this :


$item->link=str_replace( 'fournisseur/?categorylayout=default&amp;showcategory=1&amp;showproducts=1&amp;productsublayout=0', '', $item->link);
$item->link=str_replace( '?productsublayout=0', '', $item->link);


And it works
Exept the last item in productdetails view, productdetails have no pathway

So i do this :


elseif ($show_last)
{$monUrl = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
// Render last item if reqd.
echo '<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="active">';
echo '<a itemprop="url" href="' . $monUrl . '" class="pathway"><span itemprop="title">' . $item->name . '</span></a>';
echo '</li>';
}


And it works

happy end, thank you all.

Great This works just fine!!!

Leaving my code in case anyone needs it. It's an override of breadcrumbs template inside my template html folder. In my case, I dont need the link in the last breadcrumb item...
<?php
// no direct access
defined('_JEXEC') or die;
?>


<?php
echo 
'<ul class="breadcrumbs">';
    for (
$i 0$i $count$i ++) {
$list[$i]->link str_replace'manufacturer/?categorylayout=0&amp;showcategory=1&amp;showproducts=1&amp;productsublayout=0'''$list[$i]->link);
$list[$i]->link str_replace'?productsublayout=0'''$list[$i]->link);

// If not the last item in the breadcrumbs add the separator
if ($i $count -1) {
if (!empty($list[$i]->link)) echo '<li><a href="'.$list[$i]->link.'" >'.$list[$i]->name.'</a></li>';
else echo '<li class="pathway">' $list[$i]->name '</li>';
if($i $count -2) echo ' <li class="separator">/</li> ';
} else if ($params->get('showLast'1)) { // when $i == $count -1 and 'showLast' is true
if($i 0) echo ' <li class="separator">/</li> ';
echo '<li>' $list[$i]->name '</li>';
}
}
    echo 
'</ul>';
?>


Title: Re: Breadcrumbs links not SEF
Post by: vlasterx on July 31, 2016, 19:54:36 PM
Code above didn't work for me, so I have used regular expression replacement in PHP and made it work.

Instead of
$list[$i]->link = str_replace( 'manufacturer/?categorylayout=0&amp;showcategory=1&amp;showproducts=1&amp;productsublayout=0', '', $list[$i]->link);

use this one
$list[$i]->link = preg_replace('/\/manufacturer\/?(.*)/', '', $list[$i]->link);
Title: Re: Breadcrumbs links not SEF
Post by: Milbo on August 07, 2016, 14:28:05 PM
Quote from: Studio 42 on August 31, 2015, 16:15:06 PM
I already give some type to dev team to solve some error, but no answer or change from team.

as far as I know, you just gave the general advice, that it must be removed. If someone provides a patch, we take it. But so long we had no time yet.
Title: Re: Breadcrumbs links not SEF
Post by: Milbo on August 07, 2016, 14:31:15 PM
ah yes and a little hint, none of the ideas here are solutions for the core. They are all quickndirty and work only for the selected variables. Actually for me it is a router issue, because it is correctly routed in the menues. So the question is, where are the 5 lines we need to add.
Title: Re: Breadcrumbs links not SEF
Post by: Milbo on August 08, 2016, 18:55:21 PM
Btw, with the last joomla version (3.6.2), I cannot reproduce it.