98 Posts
Edwin
11 years ago
Topic

Hello

My articles have admin approval before being published. This works when user submits form for first time. But I also want the form to return to UNPUBLISHED state when the user edits the article. Anyone know how to achive this?

Thanx

Get a VIP membership
178 Posts
Jeka
11 years ago
1
Level 1

Put publish field to your content type and set in live value published state!

98 Posts
Edwin
11 years ago
0
Level 2

Hi Jeka

Thanx for your reply. If you read my question correctly, I need the article to return to UNPUBLISHED each time user edits it. For example: User submits article and it is unpublished. Administrator checks article and sets it to published. Article is now visible on frontend. User edits article and it now must return to unpublished. Only administrator can  set it to published, after checking it.

Thank you

178 Posts
Jeka
11 years ago
0
Level 1

Hi Edwin.
Try to use triggers to unpublish this article if some editable fields were changed

11 years ago
0
Level 1

Hello Edwin,


do the users and the administrator use the same form or is the user editing in site form and the administrator in admin form?

98 Posts
Edwin
11 years ago
0
Level 1

Hi Gebeer

Thank you for your response. Users and admins use the same form, but admins from backend (admin form) and users from frontend (site form).

Thanx again

178 Posts
Jeka
11 years ago
0
Level 1

Hi, Edwin. 

If users edit article just from frontend, so put your publish field in site tab ( choose hidden ), and set it to unpublish state. 

And you will get:

1. User submit article trought this form from frontend ( article will be saved as unpbulished)

2. Administrator checks article and sets it to published.

3. User edit again edit article from frontemd and save it ( article again will be save as unpublished)

4. Administrator checks article and sets it to published.

The problem is that in this way articles will be always set to unpublish, regardless of whether the user has made changes in the field or not.

Does it work for you?

The second way is to make a copy of the editable fields, making them hidden and by using triggers try to compare changes in them.
If field was not changed, just do not show save button, if yes - show.
98 Posts
Edwin
11 years ago
1
Level 1

Hi Jeka

Thank you for your help.

I already have the article state field on form, set to unpublished and is hidden. This seems to work only when user submits the form for the first time. Once admin sets it to published, it stays that way even when user edits the article. Not sure where I'm going wrong. I will try your idea on triggers and report back here.

11 years ago
0
Level 2

Hi Everybody,

It's always the same process to do things like that.

You must use "access" level on a field (button 4 in the content type edition).

Create a new "State" field by having the same storage than the native State field from SEBLOD. Put a default value to this field on "unpublished" and display this field only for registered user (button 4).

Use the default state field only for administrator (access).

Like this after a "user" modification the article will be always unpublished and for an administrator it's will the classic way.

Regards.

Sebastien.

Get a Book for SEBLOD