<?xml version="1.0" encoding="UTF-8"?>    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
      <channel>
        <title>ZenDB and images</title>
        <link>https://interactivetools.com/forum/forum-posts.php?ZenDB-and-images-82889</link>
        <description></description>
        <pubDate>Thu, 10 Sep 2026 06:00:35 -0700</pubDate>
        <language>en-us</language>
        <atom:link href="https://interactivetools.com/forum/forum-posts.php?rss=1&amp;ZenDB-and-images-82889" rel="self" type="application/rss+xml" />

                <item>
          <title>ZenDB and images</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247773#post2247773</link>
          <description><![CDATA[<p>Hi Jeff, </p>
<p>We've now got this built into the latest CMSB beta.  Here's what you can do in the beta instead of the above code: </p>
<pre class="language-php"><code>$records = DB::select('articles');
foreach ($records as $record) {
    echo "&lt;h1&gt;$record-&gt;name&lt;/h1&gt;\n";  
    foreach ($record-&gt;load('uploads') as $upload) {
        echo "&lt;img src='$upload-&gt;urlPath'&gt;&lt;br&gt;\n";
    }
}</code></pre>
<p>If you get a chance to try it out let us know any feedback.  Thanks!</p>]]></description>
          <pubDate>Wed, 27 Nov 2024 15:29:19 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247773#post2247773</guid>
        </item>
                <item>
          <title>ZenDB and images</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247641#post2247641</link>
          <description><![CDATA[<p>Hi Jeff, </p>
<p>Using getRecords() might be the easiest right now, we're working on other options for ZenDB in future.</p>
<p>Or here's a workaround using a CMSB function that gets you an array:</p>
<pre class="language-php"><code>$rows = DB::select('articles')-&gt;toArray();
addUploadsToRecords($rows, $baseTable);
showme($rows);</code></pre>
<p>Or converting it back to a SmartArray and using that.</p>
<pre class="language-php"><code>$rows = DB::select('articles')-&gt;toArray();
addUploadsToRecords($rows, $baseTable);
$rows = SmartArray::new($rows);

showme($rows);

foreach ($rows as $record) {
    echo "&lt;h1&gt;$record-&gt;name&lt;/h1&gt;\n";
    foreach ($record-&gt;uploads as $upload) {
        echo "&lt;img src='$upload-&gt;urlPath'&gt;&lt;br&gt;\n";
    }
}
</code></pre>
<p>Hope one of those solutions works for you.  </p>
<p>Cheers!</p>]]></description>
          <pubDate>Fri, 08 Nov 2024 16:25:23 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247641#post2247641</guid>
        </item>
                <item>
          <title>ZenDB and images</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247639#post2247639</link>
          <description><![CDATA[<p>I am correct that ZenDb does not return images as part of its record set and that we should use getRecords when we want images.</p>]]></description>
          <pubDate>Wed, 06 Nov 2024 13:31:20 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247639#post2247639</guid>
        </item>
              </channel>
    </rss>
  