how do i get alphabetic order
-
- Phoca Member
- Posts: 19
- Joined: 02 Aug 2010, 22:30
how do i get alphabetic order
hi, how do i get Phoca Documentation to list articles in alphabetic order ???
- Jan
- Phoca Hero
- Posts: 48402
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: how do i get alphabetic order
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
- Jan
- Phoca Hero
- Posts: 48402
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: how do i get alphabetic order
Hi, see the post above, this needs to be customized in the code
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 1
- Joined: 22 Dec 2011, 20:06
Re: how do i get alphabetic order
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;
}
}
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;
}
}
- Jan
- Phoca Hero
- Posts: 48402
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: how do i get alphabetic order
Hi, thank you for this info.
Jan
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Member
- Posts: 25
- Joined: 30 Aug 2012, 15:06
Re: how do i get alphabetic order
what about in joomla 2.5. how can I change the order of the phoca tree to alphabetical?
- Jan
- Phoca Hero
- Posts: 48402
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: how do i get alphabetic order
Hi, I think this will be the same way, only there will be other lines in new code
Jan
Jan
If you find Phoca extensions useful, please support the project