Page 2 of 3
Re: Section Showing Twice in Breadcrumbs
Posted: 11 Jul 2010, 13:39
by Jan
Aha, now I understand, the problem is not a duplication of section but the problem occurs if you will name the menu link the same as section.
In such case you need to customize the code. But there is a problem because the patway includes the menu link to download.
see e.g.:
components\com_phocadownload\views\category\view.html.php
line cca 202
Code: Select all
$pathway =& $mainframe->getPathway();
now the patway includes the menu link.
With this code the section will be added:
Code: Select all
if (!empty($section[0]->title)) {
$pathway->addItem($section[0]->title, JRoute::_(PhocaDownloadHelperRoute::getSectionRoute($section[0]->id, $section[0]->alias)));
}
So you can comment it to remove the section from the breadcrumbs, but no idea if this will not cause some url problem.
And be aware - section is link to section view but the menu link can be a link to section
s view.
Jan
Re: Section Showing Twice in Breadcrumbs
Posted: 11 Jul 2010, 18:57
by sender
Solved!!!
For me solved!
I have to do the same operation in:
components\com_phocadownload\views\section\view.html.php
Thanks. Solved!
Re: Section Showing Twice in Breadcrumbs
Posted: 12 Jul 2010, 15:22
by Jan
Ok
Re: Section Showing Twice in Breadcrumbs
Posted: 27 Aug 2010, 19:38
by pweb
The solution is:
We shouldn't show section in breadcrumbs if menu item view is section, category or file.
/components/com_phocadownload/views/category/view.html.php
Code: Select all
// Breadcrumbs
$menus = &JSite::getMenu();
$menu = $menus->getActive();
$pathway =& $mainframe->getPathway();
if (!empty($section[0]->title) && $menu->query['view'] != 'section' && $menu->query['view'] != 'category' && $menu->query['view'] != 'file') {
$pathway->addItem($section[0]->title, JRoute::_(PhocaDownloadHelperRoute::getSectionRoute($section[0]->id, $section[0]->alias)));
}
if (!empty($category[0]->title) && $menu->query['view'] != 'category' && $menu->query['view'] != 'file') {
$pathway->addItem($category[0]->title);
}
We shouldn't show category in breadcrumbs if menu item view is category or file
/components/com_phocadownload/views/section/view.html.php
Code: Select all
// Breadcrumbs
$menus = &JSite::getMenu();
$menu = $menus->getActive();
if (!empty($section[0]->title) && $menu->query['view'] != 'section' && $menu->query['view'] != 'category' && $menu->query['view'] != 'file') {
$pathway =& $mainframe->getPathway();
$pathway->addItem($section[0]->title, JRoute::_(PhocaDownloadHelperRoute::getSectionsRoute()));
}
The same you should do for file view.
Re: Section Showing Twice in Breadcrumbs
Posted: 28 Aug 2010, 14:07
by Jan
Hi, thank you for this info.
Jan
Re: Section Showing Twice in Breadcrumbs
Posted: 28 Aug 2010, 19:40
by pweb
I have forgotten to add check of component attached to the current menu Item.
Code: Select all
$menu->query['option'] == 'com_phocadownload'
Re: Section Showing Twice in Breadcrumbs
Posted: 04 Sep 2010, 21:04
by Jan
Ok
Re: Section Showing Twice in Breadcrumbs
Posted: 20 Mar 2012, 21:50
by Michael 12
I have the same problem with joomla 2.5.3 and phoca download 2.1.5., but the solution here doesn`t seem to work - I only get a white page. Has there been changes in the code and has anyone a solution?
Re: Section Showing Twice in Breadcrumbs
Posted: 22 Mar 2012, 00:40
by Jan
Re: Section Showing Twice in Breadcrumbs
Posted: 13 Apr 2012, 20:46
by chrisjclay
Here's how I solved this on my Joomla 2.5.4 site:
1. I changed the Phoca Download category names to exactly match the Joomla menu item names. I also changed Phoca sub-category names to match their Joomla sub-menu item names. I had been using slight variations (for example, I made a menu item called "Key Documents" but I had called the corresponding Phoca category simply "Documents.")
2. In components/com_phocadownload/views/category/view.html.php I found this line (around line #317):
Code: Select all
if($this->category[0]->parenttitle != $curpath[count($curpath)-1]){
... and changed it to this:
Code: Select all
if(($this->category[0]->parenttitle != $curpath[count($curpath)-2])&&($this->category[0]->parenttitle != $curpath[count($curpath)-1])){
Now the breadcrumbs are displaying properly
Cheers,
Chris