Page 1 of 1

how do i get alphabetic order

Posted: 19 Aug 2010, 04:10
by mar
hi, how do i get Phoca Documentation to list articles in alphabetic order ???

Re: how do i get alphabetic order

Posted: 21 Aug 2010, 17:11
by Jan
Hi, if there is no parameter for this, you need to customize the sql query (set ordering here)

Re: how do i get alphabetic order

Posted: 06 Nov 2010, 22:25
by Jan
Hi, see the post above, this needs to be customized in the code :-(

Re: how do i get alphabetic order

Posted: 22 Dec 2011, 20:13
by tripg
If you do better modification for J1.6/7 then you can feed off of content ordering parameters. I modified your code as follows to do just that. Please consider adopting. I did not consider backward compatible to J1.5.

category.php function _getArticleOrdering
$app->getParams(); to $app->getParams('com_content');
$params->get('article_order', 1 ); to $params->get( 'order_date', 1 ) . '.' . $params->get( 'orderby_sec', 1 );

phocadocumentation.php (helper front)

getOrderingText function:

function getOrderingText ($ordering, $category = false) {
$ordersplit = explode('.',$ordering);
if (is_array($ordersplit))
{
if(count($ordersplit) > 1)
{
$ordering = $ordersplit[1];
if ($ordersplit[0] == 'published')
{
$ordersplit[0] = 'publish_up';
}
}
}

switch ($ordering) {
case 'rdate':
if ($category) { $orderingOutput = 'lft DESC';}
else { $orderingOutput = $ordersplit[0]. ' DESC';}
break;

case 'date':
$orderingOutput = $ordersplit[0] . ' ASC';
break;

case 'alpha':
$orderingOutput = 'title' . ' ASC';
break;

case 'ralpha':
$orderingOutput = 'title DESC';
break;

case 'author':
$orderingOutput = 'created_by ASC';
break;

case 'rauthor':
$orderingOutput = 'created_by DESC';
break;

case 'hits':
$orderingOutput = 'hits ASC';
break;
case 'rhits':
$orderingOutput = 'hits DESC';
break;
case 'order':
$orderingOutput = 'ordering ASC';
break;
case 1:
default:
if ($category) { $orderingOutput = 'lft ASC';}
else { $orderingOutput = 'ordering ASC';}
break;
}
return $orderingOutput;
}

}

Re: how do i get alphabetic order

Posted: 26 Dec 2011, 22:47
by Jan
Hi, thank you for this info.

Jan

Re: how do i get alphabetic order

Posted: 15 Oct 2015, 20:07
by jbomb
what about in joomla 2.5. how can I change the order of the phoca tree to alphabetical?

Re: how do i get alphabetic order

Posted: 17 Oct 2015, 23:09
by Jan
Hi, I think this will be the same way, only there will be other lines in new code :idea:

Jan