I'm considering using ListIt2 together with FormBuilder to allow ListIt2 items to be created from a form on the frontend. (Thanks goes out to the tutorial: http://www.i-do-this.com/blog/FormBuild ... xtended/57)
I'll need these items submitted from the frontend to be moderated by an administrator before they appear on the live site, and it seems that the active/inactive setting that is built into every ListIt2 item would be ideal for hiding items awaiting moderation. The only thing is that new items seem to be set active by default. Is there a way to have new items set inactive by default?
[solved] ListIt2 - set new items inactive by default?
[solved] ListIt2 - set new items inactive by default?
Last edited by Cerulean on Wed Feb 12, 2014 8:19 am, edited 1 time in total.
-
uniqu3
Re: ListIt2 - set new items inactive by default?
How about adding following to UDT:
Code: Select all
$obj->title = $params['email'];
$obj->alias = $alias;
$obj->active = 0; // <- add this, item disabled by default
Re: ListIt2 - set new items inactive by default?
Obvious now that you mention it 
Thanks.
Thanks.
Re: ListIt2 - set new items inactive by default?
You could have a look at the events in Event Manager.
It has e.g.: PreItemSave "Sent before item save process begins. Possible to manipulate item object data."
It would probably need some debugging to find the proper properties that need to be set. And a way to prevent it from being set inactive on every save (which would make the item unusable of course).
EDIT: never mind, better listen to uniqu3
It has e.g.: PreItemSave "Sent before item save process begins. Possible to manipulate item object data."
It would probably need some debugging to find the proper properties that need to be set. And a way to prevent it from being set inactive on every save (which would make the item unusable of course).
EDIT: never mind, better listen to uniqu3
Re: [solved] ListIt2 - set new items inactive by default?
@velden
Thanks for the suggestion, but I think uniqu3 has hit upon the easiest way.
The ListIt2 field values are copied over from the FormBuilder fields by the UDT (see the tutorial I linked to above if you're curious), so it's easy to set the "active" value to 0 at the same time. Overwriting the active/inactive state of an already moderated item isn't an issue because every form submission creates a new ListIt2 item (and in my case I don't need to allow frontend users to edit their previously submitted forms).
Thanks for the suggestion, but I think uniqu3 has hit upon the easiest way.
The ListIt2 field values are copied over from the FormBuilder fields by the UDT (see the tutorial I linked to above if you're curious), so it's easy to set the "active" value to 0 at the same time. Overwriting the active/inactive state of an already moderated item isn't an issue because every form submission creates a new ListIt2 item (and in my case I don't need to allow frontend users to edit their previously submitted forms).
Re: [solved] ListIt2 - set new items inactive by default?
Just a little trick...
with the latest version of FormBuilder, you can populate a Listit2 instance ad set the active/inactive status of the item.
You can do it by choosing "*Store Results for ListItExtended" as field type and defining the instance you want to populate.
with the latest version of FormBuilder, you can populate a Listit2 instance ad set the active/inactive status of the item.
You can do it by choosing "*Store Results for ListItExtended" as field type and defining the instance you want to populate.
-
uniqu3
Re: [solved] ListIt2 - set new items inactive by default?
Latest Version 0.7.4 has bugs and should not be used, see http://forum.cmsmadesimple.org/viewtopi ... =7&t=67867.


