-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[mod_articles_latest] Option for choose an specific author(s) #20687
[mod_articles_latest] Option for choose an specific author(s) #20687
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approve language strings
@@ -73,6 +73,10 @@ public static function getList(&$params) | |||
$model->setState('filter.author_id.include', false); | |||
break; | |||
|
|||
case 'created_by' : | |||
$model->setState('filter.author_id', $params->get('author')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add default value array()
.
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use author
field type.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is true. Thank you
@@ -4,6 +4,8 @@ | |||
; 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." |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)
@@ -4,6 +4,8 @@ | |||
; 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." | |||
MOD_LATEST_NEWS_FIELD_AUTHOR_LABEL="Created by author(s)" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, done
showon="user_id:created_by" | ||
> | ||
<option value="0">JNONE</option> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
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
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. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20687. |
Pull Request for Issue #20685
Summary of Changes
New option for filter articles by a specific authors
Testing Instructions
Created by
in the optionAuthors
. Select an author(s) and save.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 asArticles - Latest
have an option for filter by authors, is incomplete if you cant choose a specific author(s).