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 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!

Dave Edis - Senior Developer
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

The first CMS Builder reference book is now available on-line!







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:

  1. Create CMS section with two fields, city and pending_city
  2. Create a front end form that updates the value of pending_city when you save it
  3. Create another form with a button that copies the pending value to the current value
  4. Expand fields that are needed
  5. Figure out how to make it user specific
  6. 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!

Dave Edis - Senior Developer
interactivetools.com