Show detail record only from the archive list

7 posts by 3 authors in: Forums > CMS Builder
Last Post: January 8, 2015   (RSS)

By gkornbluth - January 5, 2015

Hi,

Just a guess, but if you repeat the load records call just before the code that uses it, you can change the parameters fro each group of records.

Hope it helps,

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 MercerDesign - January 6, 2015

Sorry, I'm not sure what you mean. I just need to tell the archive page to just show archive detail records and not pull in ones that are ticked as current. Thanks

By claire - January 6, 2015

Hey Mercer

What you want to do is use the same getRecords call but add an additional parameter to the where clause to filter out records that are ticked as current. Do you know how to do that? If not, attach your code here and I'll take a look.

--------------------

Claire Ryan
interactivetools.com

Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By gkornbluth - January 6, 2015 - edited: January 6, 2015

 Hi,

Sorry, what I meant was, a load records call of:

list($table_of_contentsRecords, $table_of_contentsMetaData) = getRecords(array(
    'tableName'  => 'table_of_contents',
    'where'      => " revised = '1' ",
    'limit'      => 50,
  ));
  ?>

With a foreach loop of:

<?php foreach ($table_of_contentsRecords as $record): ?>
(Your code...)
 <?php endforeach; ?>

Will limit the records loaded and displayed in the code below that list records call to 50 records  where the “revised” check box is checked.

If you put another list records call below that one with different parameters, for example

 list($table_of_contentsRecords, $table_of_contentsMetaData) = getRecords(array(
    'tableName'  => 'table_of_contents',
    'where'      => " new = '1'",
    'limit'      => 10,
  ));
  ?>


With a foreach loop of:

<?php foreach ($table_of_contentsRecords as $record): ?>
(Your code...)
 <?php endforeach; ?>

This will limit the records loaded and displayed in the code below that list records call to 10 records where the “new” check box is checked.

There are a lot or recipes in my CMSB Cookbook - http://www.thecmsbcookbook.com that use this approach and others to show different types of data on the same page.

Hope that helps...

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 MercerDesign - January 7, 2015

Hi, I already have the list displaying correctly but it is the detail record that I cannot get to show correctly. I just need to show hte detail record that applies to the first archive record in the list but cannot get that to work. Thanks for your response though.

By claire - January 8, 2015

Hi Mercer, can you please attach the code for your viewer file here?

--------------------

Claire Ryan
interactivetools.com

Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/