Skip to content

[mod_articles_latest] Option for choose an specific author(s) - #20687

Merged
mbabker merged 5 commits into
joomla:3.9-devfrom
carlitorweb:modLastedArticle_createdByOption
Jun 18, 2018
Merged

mbabker merged 5 commits into
joomla:3.9-devfrom
carlitorweb:modLastedArticle_createdByOption

Conversation

@carlitorweb

@carlitorweb carlitorweb commented Jun 7, 2018

Copy link
Copy Markdown
Member

Pull Request for Issue #20685

Summary of Changes

New option for filter articles by a specific authors

Testing Instructions

  • Enter to the mod_articles_latest and choose the value Created by in the option Authors. Select an author(s) and save.
  • Go to the front end, and check the list of articles is only from the author(s) you selected

Expected result

Only articles from selected users are displayed

Actual result

The module no have the option to choose specific author(s)

Documentation Changes Required

Yes, need document the new option

Additional comments

You can use the module Articles - Category for have this, but as Articles - Latest have an option for filter by authors, is incomplete if you cant choose a specific author(s).

@brianteeman brianteeman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approve language strings

@ghost

ghost commented Jun 8, 2018

Copy link
Copy Markdown

@uzielweb can you please test as you wrote #20685?

Comment thread modules/mod_articles_latest/helper.php Outdated
break;

case 'created_by' :
$model->setState('filter.author_id', $params->get('author'));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add default value array().

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you


<field
name="author"
type="sql"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use author field type.

@carlitorweb carlitorweb Jun 8, 2018

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SharkyKZ Why? author field only lets you select, 1 user only

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

author field supports multiple attribute. Not to be mistaken with user field.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad again. author field was my first option when I was doing this PR, but, I did not saw this part of support multiple attribute inside the code. Now checking again, after you told me this, I saw it inside the JFormFieldList class. I need to buy some glasses with enough magnification 😞 . Thank you again for your time @SharkyKZ

value_field="name"
showon="user_id:created_by"
>
<option value="0">JOPTION_SELECT_AUTHORS</option>

@SharkyKZ SharkyKZ Jun 8, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Selecting 0 returns articles without author. So language constant should be JNONE or similar.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is true. Thank you

; Note : All ini files need to be saved as UTF-8

MOD_ARTICLES_LATEST="Articles - Latest"
MOD_LATEST_NEWS_FIELD_AUTHOR_DESC="Select one or more authors from the list below."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to Select one or more authors.. The list is not below but next to the label.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thank you. Also i change the label, for -> Created by author(s)


MOD_ARTICLES_LATEST="Articles - Latest"
MOD_LATEST_NEWS_FIELD_AUTHOR_DESC="Select one or more authors."
MOD_LATEST_NEWS_FIELD_AUTHOR_LABEL="Created by author(s)"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please capitalize Created by Authors since it is a label.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, done

value_field="name"
showon="user_id:created_by"
>
<option value="0">JNONE</option>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restore <option value="0">JNONE</option> please. It's a valid option.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really - you wouldnt have chosen to filter by author if yoou wanted to set it to none

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None returns articles which have no author assigned. Maybe the string could read No Author but None is what we have now (see Search Tools in com_content).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed because the same think as brian. If I there is for select an author. However, return a no author is valid too, but then you will need search for alias? because I do not see the point of show the last articles, for a no author list.

@ghost

ghost commented Jun 16, 2018

Copy link
Copy Markdown

I have tested this item ✅ successfully on 0c75fd0


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20687.

1 similar comment
@Quy

Quy commented Jun 16, 2018

Copy link
Copy Markdown
Contributor

I have tested this item ✅ successfully on 0c75fd0


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20687.

@Quy

Quy commented Jun 16, 2018

Copy link
Copy Markdown
Contributor

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20687.

@joomla-cms-bot joomla-cms-bot added RTC This Pull Request is Ready To Commit PR-3.9-dev and removed RTC This Pull Request is Ready To Commit labels Jun 16, 2018
@carlitorweb
carlitorweb deleted the modLastedArticle_createdByOption branch June 20, 2018 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Language Change This is for Translators

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants