<?xml version="1.0" encoding="UTF-8"?>    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
      <channel>
        <title>display one recordfield as heading, simple ??</title>
        <link>https://interactivetools.com/forum/forum-posts.php?display-one-recordfield-as-heading-simple-72245</link>
        <description></description>
        <pubDate>Sat, 07 Nov 2026 01:16:13 -0700</pubDate>
        <language>en-us</language>
        <atom:link href="https://interactivetools.com/forum/forum-posts.php?rss=1&amp;display-one-recordfield-as-heading-simple-72245" rel="self" type="application/rss+xml" />

                <item>
          <title>Re: [Jason] display one recordfield as heading, simple ??</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2209568#post2209568</link>
          <description><![CDATA[Thanks Jason, works perfect for me !<br />]]></description>
          <pubDate>Thu, 10 Feb 2011 05:38:48 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2209568#post2209568</guid>
        </item>
                <item>
          <title>Re: [kovali] display one recordfield as heading, simple ??</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2209552#post2209552</link>
          <description><![CDATA[Hi Koen,<br /><br />Another way of doing this could be to first organize all your records into an array sorted by year.  In this example, I'll also show how you can limit the number of records you're outputting for each header.<br /><br />First we sort all our records into an array by year:<br /><br /><br /><code> $yearToRecords = array();<br /> <br /> foreach($wineRecords as $record){<br />   <br />   $yearToRecords[$record['year']][] = $record;<br /> }</code><br /><br />Next we output our records, each under the header of their year.  We'll also set a limit of 3 records for each header:<br /><br /><code>&lt;?php $maxRecordsPerHeader = 3; ?&gt;<br /><br />&lt;?php foreach($yearToRecords as $year =&gt; $wineRecord): ?&gt;<br />  <br />  &lt;h2&gt;&lt;?php echo $year; ?&gt;&lt;/h2&gt;<br />  <br />  &lt;?php $recordCount = 0; ?&gt;<br />  &lt;?php foreach($wineRecord as $record): ?&gt;<br />     <br />     &lt;?php $recordCount++ ;?&gt;<br />     <br />     &lt;?php echo $record['name'];?&gt; &lt;br /&gt;<br />     <br />     &lt;?php if($recordCount == $maxRecordsPerHeader){ break; } ?&gt;<br />     <br />  &lt;?php endforeach ?&gt;<br /> <br /> <br />&lt;?php endforeach ?&gt;</code><br /><br />Hope this helps<br />]]></description>
          <pubDate>Wed, 09 Feb 2011 14:38:18 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2209552#post2209552</guid>
        </item>
                <item>
          <title>Re: [kovali] display one recordfield as heading, simple ??</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2209544#post2209544</link>
          <description><![CDATA[Hello Jerry, one more question if possible... <br /><br />With the &lt;break&gt; function I can now show only one record, perfect. But is there a way to show only 3 records out of 20 let's say, without using the Limit =&gt; 3 function ?? <br /><br />I need this on a page where I want to show all records (without limit...) and once again only the 3 most recent records of the same section at the top of the page... When i use Limit =&gt; 3 it will only show 3 records in both lists ofcourse... <br /><br />Thx,<br />Koen<br />]]></description>
          <pubDate>Wed, 09 Feb 2011 09:52:12 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2209544#post2209544</guid>
        </item>
                <item>
          <title>Re: [gkornbluth] display one recordfield as heading, simple ??</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2209539#post2209539</link>
          <description><![CDATA[Thanks Jerry, perfect!<br />]]></description>
          <pubDate>Wed, 09 Feb 2011 03:16:03 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2209539#post2209539</guid>
        </item>
                <item>
          <title>Re: [kovali] display one recordfield as heading, simple ??</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2209535#post2209535</link>
          <description><![CDATA[Hi Koen,<br /><br />If you nsert a  &lt;?PHP break ?&gt; in your foreach loop just before the endforeach, and that should fix the issue for you.<br /><br />The break  tells the loop to only execute once and then quit<br /><br />There are lots of recipes on how to make CMSB do what you want it to in my CMSB Cookbook <a target="_blank" href="http://www.thecmsbcookbook.com">http://www.thecmsbcookbook.com</a><br /><br />Hope that helped.<br /><br />Jerry Kornbluth<br />]]></description>
          <pubDate>Tue, 08 Feb 2011 19:42:12 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2209535#post2209535</guid>
        </item>
                <item>
          <title>display one recordfield as heading, simple ??</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2209532#post2209532</link>
          <description><![CDATA[Hi, <br /><br />I have one section called &quot;Wines&quot; with 2 fields: Name and Year. When I have some records in this section like: <br /><br />winename1 2010 <br />winename2 2010 <br />winename3 2009 <br />winename4 2009 <br />winename5 2009 <br /><br />When searching for wines of year 2009, I would like to display the results on the list page as follows: <br /><br />2009 (Heading) <br />-------------------- <br />winename3 <br />winename4 <br />winename5 <br /><br />But with &lt;?php foreach ($wineRecords as $record): ?&gt; it will always show the year 3 times also... but I only need it once (as header) [:(] <br /><br />Is there a way to solve this please? <br />Thx, <br /><br />Koen<br />]]></description>
          <pubDate>Tue, 08 Feb 2011 14:46:15 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2209532#post2209532</guid>
        </item>
              </channel>
    </rss>
  