Sort Articles by Created_by_Alias - Joomla! Forum - community, help and support
i know old post, method above works. know if there similar fix adding in 'created alias' can sort articles author, opposed person posting articles.
any ideas on this?
any ideas on this?
yes, possible. however, may require of core joomla! files changed. @ least have change 2 files.
(a) joomla! file cannot overridden
edit file articles.php located in directory \administrator\components\com_content\models , add following lines of code.
before edit:
after edit:
before edit:
after edit:
note: make sure take copy of file before editing it. file may overwritten future releases of joomla!
(b) joomla! file overridden
edit file default.php located in directory \administrator\components\com_content\views\articles\tmpl , change following lines of code.
before edit:
after edit:
before edit:
after edit:
note: fact file overridden, suggest following output override technique documented @ http://docs.joomla.org/how_to_override_the_output_from_the_joomla!_core.
still work may needed if want add filter created alias column.
(a) joomla! file cannot overridden
edit file articles.php located in directory \administrator\components\com_content\models , add following lines of code.
before edit:
code: select all
...
'created_by', 'a.created_by',
'ordering', 'a.ordering',
...after edit:
code: select all
...
'created_by', 'a.created_by',
'created_by_alias', 'a.created_by_alias',
'ordering', 'a.ordering',
...before edit:
code: select all
...
', a.state, a.access, a.created, a.created_by, a.ordering, a.featured, a.language, a.hits' .
...after edit:
code: select all
', a.state, a.access, a.created, a.created_by, a.created_by_alias, a.ordering, a.featured, a.language, a.hits' .note: make sure take copy of file before editing it. file may overwritten future releases of joomla!
(b) joomla! file overridden
edit file default.php located in directory \administrator\components\com_content\views\articles\tmpl , change following lines of code.
before edit:
code: select all
...
<?php echo jhtml::_('grid.sort', 'jgrid_heading_created_by', 'a.created_by', $listdirn, $listorder); ?>
...after edit:
code: select all
...
<?php echo jhtml::_('grid.sort', 'jgrid_heading_created_by', 'a.created_by_alias', $listdirn, $listorder); ?>
...before edit:
code: select all
...
<?php echo $this->escape($item->author_name); ?>
...after edit:
code: select all
...
<?php echo $this->escape($item->created_by_alias); ?>
...note: fact file overridden, suggest following output override technique documented @ http://docs.joomla.org/how_to_override_the_output_from_the_joomla!_core.
still work may needed if want add filter created alias column.
Comments
Post a Comment