-
☆ A M B ☆
- 450 Posts
Is there any way to limit the users who show up in the "Created By" dropdown when creating or editing a blog post? The default seems to be to show every single user in the user table - even inactive ones. It would be nice to be able to limit this to a specific user group.
This should work:
Hide the field,
set the value to the content of a new tv using form customization
create a custom select list tv including the names of the users you want to be available.
The list can be automatically created by a sql statement inside the tvs value field or manually edited.
Regards,
pepebe
-
☆ A M B ☆
- 222 Posts
I had tried some form customizations, even adding javascript to attempt to move some things on the custom resource type, and it just seems that the custom resource goodies run after all the mgr default, plugins and form customizations run.
-
☆ A M B ☆
- 450 Posts
I think the easiest short-term solution for me personally is to refactor my other custom app - which currently uses the Users table, and move those records to a custom table (there's no reason they need to be MODX users, I just used that table because it was quick and had the fields I needed). That will de-clutter the Created By dropdown on this install.
The proper long-term, robust solution seems to be to enhance Articles to allow a particular user group to be specified for use in the Created By dropdown.
Thoughts anyone?
-
☆ A M B ☆
- 450 Posts
I think the easiest short-term solution for me personally is to refactor my other custom app - which currently uses the Users table, and move those records to a custom table (there's no reason they need to be MODX users, I just used that table because it was quick and had the fields I needed). That will de-clutter the Created By dropdown on this install.
The proper long-term, robust solution seems to be to enhance Articles to allow a particular user group to be specified for use in the Created By dropdown.
Thoughts anyone?
Sorry, I didn't check this.
I have to admit that I can't even find a "Created By" dropdown in my resources. I know its in the table and I believe I have seen it in the past, but I'm not sure about any more.
Why don't you go for a custom Tv and later used the value to accomplish things?
Populating a select TV with users that meet certain requirements is easy:
@SELECT `username` AS `name`,`id` FROM `[[+PREFIX]]users` WHERE `active` = 1
Code copied from: http://rtfm.modx.com/revolution/2.x/making-sites-with-modx/customizing-content/template-variables/bindings/select-binding
This will return the name of the choosen user and limit the list to active ones.
Regards,
pepebe