6

I am looking for the simplest way to create a menu item that lists all articles by a specific author.

Any help is appreciated. Elad.

3 Answers 3

4

There is another solution that you can use which doesn't require any installs or modifications.

First create a new module of type: "Articles - Category". This type of module allows you to filter results by author:

Joomla 3 - adding new module

Choose author(s):

Choose author(s) Then, create an article and load the module created above, using:

{loadposition position[, style]}
{loadmodule module[, title[, style]]}

Finally create a new menu item pointing to the specific article.

3

This is not provided by default from Joomla. You could either use a module, create your own model-view with a custom menu item, or use 3rd party content component or CCKs like k2.

Joomla Content - List by Author Options

1. Use module:

You could search in JED for modules that filter by user and use a module
- either embed it inside an article
- or to a module position at the content area of a blog menu item that you will set to display 0 articles.

I could suggest Raxo All-mode pro, which has Author Filters and a lot of display options.


2. Create your own View/Model for com_content:

if you want to display articles using the com_content component, then you will have to create your own Model/View and create a menu item.

I think you could easily base your menu item on the Featured MV.

So a basic implementation would be like:

  1. Duplicate in components/com_content/

    a. the models/featured.php file
    b. the views/featured/ folder


  1. Rename them to something like author.php and views/author/ respectively.


  1. Then open models/author.php and

    a. edit Class Name to:

    class ContentModelAuthor 
    { //.... class code goes here....
    

    b. Remove any query that filters for the front-page (featured items).

    c. Add your WHERE for the author ID, like:

     $query->where('a.created_by ='.$params->get('author', '')); 
      // You should use the name of this param that you will define in the default.xml later.
    


  1. In views/author folder:

    a. Edit in view.html.php the Class Name to:

    class ContentViewAuthor extends JViewLegacy { //.... class code goes here....}


  1. Open the views/author/tmpl/default.xml and

    a. edit titles to something like:

    b. Add the author field, to select the User you want to filter on:

Create a new menu item, select a user to test it. These should be the basics, and most likely at this point you will have blog layouts that will be filtered by user.
You can go further at your own.

Report back any issues, as this is a quick solution and not really tested.

Also, so far, the structural organization of the articles will still be the categories and not the user entity.


3. Use 3rd party content component, like K2

K2 provides this feature to create authors' article pages.

0

Articles Anywhere Pro can help with this by using {if} tags to filter out articles you don't want to show.

See filter by article author ID for more details.

November 2018 Update:

As at Joomla 3.9.0, the "Latest Articles" module now has an option to display articles by a specific author. You can set up a module with a custom module position and then add this to an article using {loadposition custom-module-position} or similar.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.