Having problems viewing list records in a detail records page

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

By meg - November 24, 2014

I have essentially an article page with a view all articles at the footer. I can't get the list of all the articles to view. Not sure what's going on. I'm using this code: 

list($articlesRecords, $articlesMetaData) = getRecords(array(
    'tableName'   => 'articles',
    'where'       => whereRecordNumberInUrl(1), 
    'loadUploads' => true,
    'allowSearch' => true,
    'limit'       => '1',
  ));
  $detailRecord = @$articlesRecords[0];
  
  list($articlesRecords, $articlesMetaData) = getRecords(array(
    'tableName'   => 'articles',
    'perPage'     => '6',
    'loadUploads' => true,
    'allowSearch' => false,
  ));
  
   list($prevRecord, $nextRecord, $firstRecord, $lastRecord) = getPrevAndNextRecords(array( 
    'tableName' => 'articles', 
    'recordNum' => $detailRecord['num'], 
    'orderBy'   => 'createdDate'
  ));

<?php foreach ($articlesRecords as $listRecord): ?>
<?php $isSelected = ($listRecord['num'] == $detailRecord['num']); ?>
<?php if ($isSelected) { print "<b>"; } ?>
<!--Article-->
<div class="mosaic-block fade">
<a href="<?php echo htmlencode($listRecord['_link']) ?>" class="mosaic-overlay">
<div class="details" align="center">
<h6><?php echo htmlencode($listRecord['life:text']) ?></h6>
<h6><?php echo htmlencode($listRecord['style:text']) ?></h6>
<h5><?php echo htmlencode($listRecord['title']) ?></h5>
<h4><?php echo htmlencode($listRecord['byline']) ?></h4>
<p>SEE FEATURE <img src="images/white-arrow.png" alt="&gt;" width="8" height="8" border="0" /></p>
</div>
</a>
<div class="mosaic-backdrop" style="background: url(<?php foreach ($listRecord['article_images'] as $index => $upload): ?><?php if ($index >= 1) { continue; } // limit uploads shown ?><?php echo $upload['urlPath'] ?><?php endforeach ?>) top center no-repeat; -webkit-background-size: cover; -moz-background-size: cover; background-size: cover; -o-background-size: cover;"></div>
</div>
<!--END Article-->
<?php if ($isSelected) { print "</b>"; } ?>
<?php endforeach ?>

any suggestions??