how do i get alphabetic order

Phoca Documentation - creating documentation in Joomla! CMS
mar
Phoca Member
Phoca Member
Posts: 19
Joined: 02 Aug 2010, 22:30

how do i get alphabetic order

Post by mar »

hi, how do i get Phoca Documentation to list articles in alphabetic order ???
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47794
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: how do i get alphabetic order

Post by Jan »

Hi, if there is no parameter for this, you need to customize the sql query (set ordering here)
If you find Phoca extensions useful, please support the project
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47794
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: how do i get alphabetic order

Post by Jan »

Hi, see the post above, this needs to be customized in the code :-(
If you find Phoca extensions useful, please support the project
tripg
Phoca Newbie
Phoca Newbie
Posts: 1
Joined: 22 Dec 2011, 20:06

Re: how do i get alphabetic order

Post 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;
}

}
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47794
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: how do i get alphabetic order

Post by Jan »

Hi, thank you for this info.

Jan
If you find Phoca extensions useful, please support the project
jbomb
Phoca Member
Phoca Member
Posts: 25
Joined: 30 Aug 2012, 15:06

Re: how do i get alphabetic order

Post by jbomb »

what about in joomla 2.5. how can I change the order of the phoca tree to alphabetical?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47794
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: how do i get alphabetic order

Post by Jan »

Hi, I think this will be the same way, only there will be other lines in new code :idea:

Jan
If you find Phoca extensions useful, please support the project
Post Reply