5 posts by 2 authors in: Forums > CMS Builder
Last Post: August 9, 2016   (RSS)

Hi, I followed this post (http://www.interactivetools.com/forum/forum-posts.php?postNum=2230025#post2230025) but I don't need the next and previous links, it doesn't work without them, I basically need the first two articles to display from a multi record list (latest_news), the first article to display in one div and the second to display in a different div. Thanks in advance.

By Damon - August 5, 2016

How about this:

list($newRecords, $newsMetaData) = getRecords(array(
'tableName' => 'new',
'limit' => '2',
'loadUploads' => true,
'allowSearch' => false,
));

This will load the latest 2 articles.

And this will put each of the article content into a div:

<?php foreach ($newsRecords as $record): ?>
  <div>
     <?php echo htmlencode($record['title']) ?><br />
     ...add more content here as needed...
   </div>
<?php endforeach ?>

---------------------------------------------------
Cheers,
Damon Edis - interactivetools.com

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

Thanks that works but how can I make the two DIVS different, I want the first story to be in a larger DIV and the second one in a smaller sized one.

That's brilliant thanks. Works perfectly!