Featured Article from existing Articles section

12 posts by 2 authors in: Forums > CMS Builder
Last Post: January 14, 2010   (RSS)

Re: [apdance9] Featured Article from existing Articles section

By Chris - January 14, 2010

Hi April,

The problem here is that you're using the same variable name for both lists of records. When you do the second getRecords(), (which gets your featured articles,) you're overwriting your list of all articles for the category. The solution is to use two separate variable names, changes in red:

list($allArticlesRecords, $articlesMetaData) = getRecords(array(
'tableName' => 'articles',
'where' => " category LIKE '%\tElementary Years\t%' ",
));

...

list($featuredArticlesRecords, $articlesMetaData) = getRecords(array(
'tableName' => 'articles',
'where' => 'num IN (' . $elementaryRecord['featured_article_nums'] . ')',
));

...

<td width="48" height="177">&nbsp;</td><?php foreach ($featuredArticlesRecords as $record): ?>

...

<?php foreach ($allArticlesRecords as $record): ?>


I hope this helps! Please let me know if you have any questions. :)
All the best,
Chris