Details Issue and Breadcrumbs
Posted: 13 Jan 2012, 08:00
Wanted to say thanks for this module plugins. 
Using (offline, for now):
Joomla_1.7.3
com_phocadownload_v2.1.4
plg_content_phocadownload_v2.1.4
plg_editors-xtd_phocadownload_v2.1.4
plg_search_phocadownload_v2.0.1
I'm having a small issue with the details for the downloads. Sometimes the show up just fine, and sometimes there's no details at all.
IE: If the details are set to "bottom", the details appear below the link and are always shown. If it's set to "popup[thingy]", the details appear in a popup window after the Details button has been pressed. Either way, sometimes, the details don't appear in either place. So there will be no details below the link (bottom) and/or no details in the window that pops up.
I'm trying to search the board here for info, but I keep getting a "sorry, this board is unavailable right now" page about every 5 min for some reason. Busy forum or something. :/
On a side note:
I noticed the breadcrumbs only worked correctly up to a certain depth (3 I think). Then the first most crumb would start being overwritten by the next one up, and so on. I have a workaround, but I'm not sure if it's right (I'm pretty new to Joomla).
/components/com_phocadownload/models/category.php (around line 77)
Find:
Replace:
By removing the "if (empty($this->_category))" check, it can be called from elsewhere - but is that ok/correct?
/components/com_phocadownload/views/category/view.html.php (around line 283)
Find:
Replace:
Since the check on the function getCategory() has been commented out (above), I can grab the category info for any cat by passing it the id - but is this ok/correct?
Root level categories have an id of "0", so based on the other Joomla code, it should add the current page to the breadcrumb first (without link text, so that it's not clickable - since you're already there). Then while the categories have parents, move up the the path until the root is reached.
Like I said, it works, but I'm not sure it's right
Thanks
Using (offline, for now):
Joomla_1.7.3
com_phocadownload_v2.1.4
plg_content_phocadownload_v2.1.4
plg_editors-xtd_phocadownload_v2.1.4
plg_search_phocadownload_v2.0.1
I'm having a small issue with the details for the downloads. Sometimes the show up just fine, and sometimes there's no details at all.
IE: If the details are set to "bottom", the details appear below the link and are always shown. If it's set to "popup[thingy]", the details appear in a popup window after the Details button has been pressed. Either way, sometimes, the details don't appear in either place. So there will be no details below the link (bottom) and/or no details in the window that pops up.
I'm trying to search the board here for info, but I keep getting a "sorry, this board is unavailable right now" page about every 5 min for some reason. Busy forum or something. :/
On a side note:
I noticed the breadcrumbs only worked correctly up to a certain depth (3 I think). Then the first most crumb would start being overwritten by the next one up, and so on. I have a workaround, but I'm not sure if it's right (I'm pretty new to Joomla).
/components/com_phocadownload/models/category.php (around line 77)
Find:
Code: Select all
function getCategory($categoryId) {
if (empty($this->_category)) {
$query = $this->_getCategoriesQuery( $categoryId, FALSE );
$this->_category = $this->_getList( $query, 0, 1 );
}
return $this->_category;
}Code: Select all
function getCategory($categoryId) {
//if (empty($this->_category)) { // <-- comment this line
$query = $this->_getCategoriesQuery( $categoryId, FALSE );
$this->_category = $this->_getList( $query, 0, 1 );
//} // <-- comment this line
return $this->_category;
}/components/com_phocadownload/views/category/view.html.php (around line 283)
Find:
Code: Select all
// Breadcrumbs TODO (Add the whole tree)
$pathway = $app->getPathway();
if (isset($this->category[0]->parentid)) {
if ($this->category[0]->parentid == 0) {
// $pathway->addItem( JText::_('COM_PHOCADOWNLOAD_CATEGORIES'), JRoute::_(PhocaDownloadHelperRoute::getCategoriesRoute()));
} else if ($this->category[0]->parentid > 0) {
$curpath = $pathway->getPathwayNames();
if($this->category[0]->parenttitle != $curpath[count($curpath)-1]){
$pathway->addItem($this->category[0]->parenttitle, JRoute::_(PhocaDownloadHelperRoute::getCategoryRoute($this->category[0]->parentid, $this->category[0]->parentalias)));
}
}
}
if (!empty($this->category[0]->title)) {
$curpath = $pathway->getPathwayNames();
if($this->category[0]->title != $curpath[count($curpath)-1]){
$pathway->addItem($this->category[0]->title);
}
}Code: Select all
$model = &$this->getModel();
$id = (int) $this->category[0]->id;
if ($menu) {
$path = array(array('title' => $this->category[0]->title, 'link' => ''));
$category = $model->getCategory($this->category[0]->parentid);
while (($id != $category[0]->id) && $category[0]->id > 0)
{
$path[] = array('title' => $category[0]->title, 'link' => JRoute::_(PhocaDownloadHelperRoute::getCategoryRoute($category[0]->id, $category[0]->alias)));
$category = $model->getCategory($category[0]->parentid);
if (!is_object($category))
continue;
}
$path = array_reverse($path);
foreach ($path as $item)
{
$pathway->addItem($item['title'], $item['link']);
}
}Root level categories have an id of "0", so based on the other Joomla code, it should add the current page to the breadcrumb first (without link text, so that it's not clickable - since you're already there). Then while the categories have parents, move up the the path until the root is reached.
Like I said, it works, but I'm not sure it's right
Thanks