Custom Preview Page - Need Way to Show Hidden and Date-unpubished Articles

5 posts by 3 authors in: Forums > CMS Builder
Last Post: July 31, 2013   (RSS)

Hi there,

Still fighting with the on-board preivew function and am about to declare defeat at it's hands. :) Have opted to build a custom preview page for one particular muti-record table on a project. However, to do this, I need to override the hidden value and the publishStart & publishEnd dates. Can anyone offer a quick way to approach this?

Many thanks,

J.

Thanks Jerry! That does help out and we can create a partial workaround with it. If you do have a brainwave about the publishDate override, I'd appreciate knowing it.I'm sure I'm missing something regarding the Preview function, but I really can never get it to work on my projects. It should be able to provide the function we need here, but...Cheers,

J.

By gregThomas - July 31, 2013

Hi J,

If you're using a getRecords function to retrieve your data you can get it to override the hidden and display before/after dates with these variables:

  // load records from 'blog'
list($blogRecords, $blogMetaData) = getRecords(array(
  'tableName'         => 'blog',
  'loadUploads'       => true,
  'allowSearch'       => false,
  'ignoreHidden'      => true,  // don't hide records with hidden flag set
  'ignorePublishDate' => true,  // don't hide records with publishDate > now
  'ignoreRemoveDate'  => true,  // don't hide records with removeDate < now
));

So these array keys tell the getRecords function to ignore the hidden field, publish and remove dates.

Cheers!

Greg

Greg Thomas







PHP Programmer - interactivetools.com

DING! We have a winner!

Thanks Greg. That's invaluable info for our needs.

Cheers,

J.