Showing old field content until updated content is approved?
4 posts by 2 authors in: Forums > CMS Builder
Last Post: July 1, 2015 (RSS)
By gkornbluth - June 22, 2015
Hi all,
Just thinking.
Has anyone worked out an easy way to show the original content of a database field on a site until updated content for that field has been approved by the section admin (some time later)?
I already send an email to the section admin informing each time there's an update, but it might be a while before the update can be approved..
Don't know, maybe I'm just not thinking clearly today, but if I toggle the hidden check box, after the update, (as I would with entirely new record) the entire record will be hidden until the update is approved, and that's not the result I'm looking for..
Updates are accomplished by a front end form, and I thought of creating a temp field for each changeable field and switching back and forth somehow, but that felt like it would get really complicated, really quickly.
Maybe not though, and I thought I'd throw it out to the experts before I started down a garden path that might lead me over a cliff.
Thanks for looking,
Jerry Kornbluth
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php
By Dave - June 30, 2015
Hi Jerry,
Would the content be being updated in the CMS or by a front end form?
Typically the way to do it is either using multiple records or multiple field (a duplicate set of fields prefixed with "Pending: "). Then on click of an approval button copy the values from one set of fields to the other.
Cheers!
interactivetools.com
By gkornbluth - July 1, 2015
Hi Dave,
Thanks for looking at this.
I kind of thought that a front end form and duplicate fields might be the way to go, but I don't have a cllue how to copy them into the approved fields at the click of an approved button.
Were you thinking of a front end form fort that also?
Any pointers?
Best,
Jerry Kornbluth
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php
By Dave - July 1, 2015
Hi Jerry,
Well it's definitely going to need you to do some custom programming, but what I do what I have a complicated problem is just break it down into steps:
- Create CMS section with two fields, city and pending_city
- Create a front end form that updates the value of pending_city when you save it
- Create another form with a button that copies the pending value to the current value
- Expand fields that are needed
- Figure out how to make it user specific
- Integrate all the code together and ensure it does what you need
Here's some sample code for updating the field:
$tableName = "about";
$recordNum = 1;
$colsToValues = array(
'city=' => 'pending_city',
);
mysql_update($tableName, $recordNum, null, $colsToValues);
Good luck!
interactivetools.com