Author Topic: Breadcrumbs links not SEF  (Read 14208 times)

-Tony-

  • Beginner
  • *
  • Posts: 19
Breadcrumbs links not SEF
« 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

-Tony-

  • Beginner
  • *
  • Posts: 19
Re: Breadcrumbs links not SEF
« Reply #1 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...

-Tony-

  • Beginner
  • *
  • Posts: 19
Re: Breadcrumbs links not SEF
« Reply #2 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/

franzpeter

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 467
    • 2in1-online | Software, Mac, PC, Netzwerk, Drucker, Pad, Display
  • VirtueMart Version: Virtuemart 3.2.6
Re: Breadcrumbs links not SEF
« Reply #3 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?

franzpeter

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 467
    • 2in1-online | Software, Mac, PC, Netzwerk, Drucker, Pad, Display
  • VirtueMart Version: Virtuemart 3.2.6
Re: Breadcrumbs links not SEF
« Reply #4 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.

-Tony-

  • Beginner
  • *
  • Posts: 19
Re: Breadcrumbs links not SEF
« Reply #5 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 ?

-Tony-

  • Beginner
  • *
  • Posts: 19
Re: Breadcrumbs links not SEF
« Reply #6 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 :

Code: [Select]
<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

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3905
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Breadcrumbs links not SEF
« Reply #7 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  ;)

franzpeter

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 467
    • 2in1-online | Software, Mac, PC, Netzwerk, Drucker, Pad, Display
  • VirtueMart Version: Virtuemart 3.2.6
Re: Breadcrumbs links not SEF
« Reply #8 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.

-Tony-

  • Beginner
  • *
  • Posts: 19
Re: Breadcrumbs links not SEF
« Reply #9 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 :

Code: [Select]
//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 ;)

-Tony-

  • Beginner
  • *
  • Posts: 19
Re: Breadcrumbs links not SEF
« Reply #10 on: June 17, 2015, 10:58:37 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.

Miku

  • Jr. Member
  • **
  • Posts: 79
  • A beginner
  • VirtueMart Version: 3.0.18, J!3.6.4

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10337
  • VirtueMart Version: 3+
Re: Breadcrumbs links not SEF
« Reply #12 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>';
      }
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

-Tony-

  • Beginner
  • *
  • Posts: 19
Re: Breadcrumbs links not SEF
« Reply #13 on: June 17, 2015, 17:38:51 pm »
Yeaah ! thank you very much !

So i do this :

Code: [Select]
$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 :

Code: [Select]
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.

vinhbui2488

  • Beginner
  • *
  • Posts: 6
  • Skype Name: vinhbui2488
Re: Breadcrumbs links not SEF
« Reply #14 on: July 29, 2015, 17:08:24 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 :
Code: [Select]
<?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