Question about headlines on the footer

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

By Jesus - November 1, 2013

Hello,

I've my website almost ready to go but I just found something and I hope you can give me a clue on how to do this. Everything its working fine BUT this.

I've my footer showing the latest 2 headlines from my press releases table, and that works perfectly on all my pages around the website, however... when I came to my Press Release page I've an issue as I'm showing all my headlines on my index page and I also need to keep my footer showing the latest 2 headlines (from the same press releases table) to keep my footer uniform all over my website.

So here's the code I've on my header...

  // load records from 'press_releases'
  list($press_releasesRecords, $press_releasesMetaData) = getRecords(array(
    'tableName'   => 'press_releases',
    'loadUploads' => true,
    'allowSearch' => false,
  ));

  // load records from 'events'
  list($eventsRecords, $eventsMetaData) = getRecords(array(
    'tableName'   => 'events',
    'loadUploads' => true,
    'allowSearch' => false,
  ));

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

But as you can see, I'm loading 2 times my press_releases records (one for the index content page) and the other one for my footer content... or what's the best way to display all my press releases on the index and just a 2 limit on my footer on cases like this?

I hope I'm explaining this properly, thanks in advance for your help!

Jesus