Question about headlines on the footer

2 posts by 2 authors in: Forums > CMS Builder
Last Post: November 3, 2013   (RSS)

By ht1080z - November 3, 2013 - edited: November 3, 2013

Hi Jesus,

You need to call the section with different names on the same page, example:

  // load records from 'press_releases'
  // for the main section of the page

  list($all_press_releasesRecords, $all_press_releasesMetaData) = getRecords(array(
    'tableName'   => 'press_releases',
    'loadUploads' => true,
    'allowSearch' => false,
  ));

  // load records from 'press_releases'
  // for the footer section of the page

  list($press_releasesRecords, $press_releasesMetaData) = getRecords(array(
    'tableName'   => 'press_releases',
    'loadUploads' => true,
    'allowSearch' => false,
    'limit'       => '2',
  ));

Remember, you can name each query as you like and call as many times you want in the same page, but you need to change the array names for each. Example, the third one for the sidebar...

  // load records from 'press_releases'
  // additional records for the sidebar (the 5 latest post)

  list($sidePressRecords, $sidePressMetaData) = getRecords(array(
    'tableName'   => 'press_releases',
    'loadUploads' => true,
    'allowSearch' => false,
    'orderBy'     => "date DESC",
    'limit'       => '5',
  ));

and create the print out for the array depending on the array name like:

foreach($sidePressRecords as $sidePress) {
    echo $sidePress['title'];
}

I hope this will help,
Karls