<?xml version="1.0" encoding="UTF-8"?>    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
      <channel>
        <title>Displaying dynamic content</title>
        <link>https://interactivetools.com/forum/forum-posts.php?Displaying-dynamic-content-78600</link>
        <description></description>
        <pubDate>Sat, 11 Jul 2026 13:19:03 -0700</pubDate>
        <language>en-us</language>
        <atom:link href="https://interactivetools.com/forum/forum-posts.php?rss=1&amp;Displaying-dynamic-content-78600" rel="self" type="application/rss+xml" />

                <item>
          <title>Displaying dynamic content</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2229964#post2229964</link>
          <description><![CDATA[<p>Perfect! The panel on the right of this page is selected from the panels that were input via the Insets section I set up in CSMB: <a href="http://kathiejordandesign.com.previewdns.com/services.php." rel="nofollow">http://kathiejordandesign.com.previewdns.com/services.php.</a> Exactly how I needed this to work.</p>
<p>Thanks so much for your patience and advice.</p>]]></description>
          <pubDate>Thu, 21 Mar 2013 07:33:08 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2229964#post2229964</guid>
        </item>
                <item>
          <title>Displaying dynamic content</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2229957#post2229957</link>
          <description><![CDATA[<p>Hi Nigel, </p>
<p>Sorry, I didn't make that very clear. You don't need to add the $pages getRecords functions to your code, that was just an example of how the code could be implemented into a site. </p>
<p>If your trying to implement this into the services.php page, then your the code that at the top of the page should probably look like this:</p>
<p><code> &lt;?php header('Content-type: text/html; charset=utf-8'); ?&gt;<br />&lt;?php<br />  /* STEP 1: LOAD RECORDS - Copy this PHP code block near the TOP of your page */<br />  <br />  // load viewer library<br />  $libraryPath = 'cmsAdmin/lib/viewer_functions.php';<br />  $dirsToCheck = array('/home/content/63/10722363/html/','','../','../../','../../../');<br />  foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}<br />  if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }<br /><br />  // load record from 'homepage'<br />  list($homepageRecords, $homepageMetaData) = getRecords(array(<br />    'tableName'   =&gt; 'homepage',<br />    'where'       =&gt; '', // load first record<br />    'loadUploads' =&gt; true,<br />    'allowSearch' =&gt; false,<br />    'limit'       =&gt; '1',<br />  ));<br />  $homepageRecord = @$homepageRecords[0]; // get first record<br />  if (!$homepageRecord) { dieWith404("Record not found!"); } // show error message if no record found<br /><br />  list($footer_contentRecords, $footer_contentMetaData) = getRecords(array(<br />    'tableName'   =&gt; 'footer-content',<br />    'where'       =&gt; '', // load first record<br />    'loadUploads' =&gt; true,<br />    'allowSearch' =&gt; false,<br />    'limit'       =&gt; '1',<br />  ));<br />  $footer_contentRecord = @$footer_contentRecords[0]; // get first record<br />  if (!$footer_contentRecord) { dieWith404("Record not found!"); } // show error message if no record found<br /><br /><br />  list($servicesRecords, $servicesMetaData) = getRecords(array(<br />    'tableName'   =&gt; 'services',<br />    'where'       =&gt; '', // load first record<br />    'loadUploads' =&gt; true,<br />    'allowSearch' =&gt; false,<br />    'limit'       =&gt; '1',<br />  ));<br />  $servicesRecord = @$servicesRecords[0]; // get first record<br />  if (!$servicesRecord) { dieWith404("Record not found!"); } // show error message if no record found<br /><br /><br />  // load record from 'insets-panels' uses the selected panel from the services section.<br />  list($insets_panelsRecords, $insets_panelsMetaData) = getRecords(array(<br />    'tableName'   =&gt; 'insets-panels',<br />    'where'       =&gt; 'num = '.$servicesRecord['<span style="color:#ff6600;">name_of_list_field</span>'],<br />    'loadUploads' =&gt; true,<br />    'allowSearch' =&gt; false,<br />    'limit'       =&gt; '1',<br />  ));<br />  $insets_panel = @$insets_panelsRecords[0]; // get first record<br />  if (!$insets_panel) { dieWith404("Record not found!"); } // show error message if no record found<br /><br />?&gt;</code></p>
<p>You will need to change the <span>name_of_list_field variable to the name of the field that contains the list that stores the inset-panels section num variable.</span></p>
<p>I think the html to display the inset panel record should look like this:</p>
<p><code>&lt;link href="styles.css" rel="stylesheet" type="text/css" /&gt;<br />        &lt;table width="100" border="0" cellpadding="0" cellspacing="0"&gt;<br />          &lt;tr&gt;<br />          <br />   &lt;?php foreach ($insets_panel['image'] as $index =&gt; $upload): ?&gt;<br />&lt;td width="&lt;?php echo $upload['width'] ?&gt;" height="&lt;?php echo $upload['height'] ?&gt;" valign="baseline" background="&lt;?php echo $upload['urlPath'] ?&gt;" id="tdHomeInset245"&gt;<br />&lt;a href="&lt;?php echo htmlencode($insets_panel['link']) ?&gt;"&gt;<br />&lt;img src="images/single-pixel.gif" width="245" height="198" border="0"&gt;<br />&lt;/a&gt;<br />&lt;/td&gt;<br />&lt;?php endforeach ?&gt; <br />            &lt;/tr&gt;<br />          &lt;tr&gt;<br />            &lt;td&gt;&lt;img src="images/single-pixel.gif" width="253" height="10" /&gt;&lt;/td&gt;<br />          &lt;/tr&gt;<br />          &lt;tr&gt;<br />            &lt;td&gt;&lt;h2&gt;&lt;a href="&lt;?php echo htmlencode($insets_panel['link']) ?&gt;"&gt;&lt;?php echo htmlencode($insets_panel['title']) ?&gt;&lt;/a&gt;&lt;/h2&gt;<br />&lt;?php echo $insets_panelsRecord['content']; ?&gt;<br />              &lt;p&gt; &lt;strong&gt;&lt;a href="&lt;?php echo htmlencode($insets_panel['link']) ?&gt;"&gt;More »&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;<br />            &lt;/tr&gt;<br />      &lt;/table&gt;</code></p>
<p>I copied this from insetDetail.php page and changed the name of the variables to use the $<span>insets_panel instead. You can use whatever html layout you want to use. So just copy these variables where you want the inset panel to appear.</span></p>
<p>Hopefully I'm a bit clearer this time, let me know if you have any questions.</p>
<p>Thanks!</p>
<p>Greg</p>]]></description>
          <pubDate>Wed, 20 Mar 2013 17:13:50 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2229957#post2229957</guid>
        </item>
                <item>
          <title>Displaying dynamic content</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2229921#post2229921</link>
          <description><![CDATA[<p>Not sure if these will help, too.</p>
<p><a href="http://kathiejordandesign.com.previewdns.com/insetIndex.php" rel="nofollow">http://kathiejordandesign.com.previewdns.com/insetIndex.php</a></p>
<p><a href="http://kathiejordandesign.com.previewdns.com/insetDetail.php?Window-Treatments-1" rel="nofollow">http://kathiejordandesign.com.previewdns.com/insetDetail.php?Window-Treatments-1</a></p>
<p><a href="http://kathiejordandesign.com.previewdns.com/insetDetail.php?Annie-Sloan-Paint-2" rel="nofollow">http://kathiejordandesign.com.previewdns.com/insetDetail.php?Annie-Sloan-Paint-2</a></p>
<p><a href="http://kathiejordandesign.com.previewdns.com/insetDetail.php?Heading-3-3" rel="nofollow">http://kathiejordandesign.com.previewdns.com/insetDetail.php?Heading-3-3</a></p>
<p><a href="http://kathiejordandesign.com.previewdns.com/insetDetail.php?Heading-2-4" rel="nofollow">http://kathiejordandesign.com.previewdns.com/insetDetail.php?Heading-2-4</a></p>
<p>Files for these pages are attached.</p>]]></description>
          <pubDate>Tue, 19 Mar 2013 11:12:21 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2229921#post2229921</guid>
        </item>
                <item>
          <title>Displaying dynamic content</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2229919#post2229919</link>
          <description><![CDATA[<p>Thanks for your advice, Greg.</p>
<p>I've attached one of the sample pages where I would like the inset panel to appear, like a "dynamic" include, as it were. This is how it should look: <a href="http://kathiejordandesign.com.previewdns.com/services.php" rel="nofollow">http://kathiejordandesign.com.previewdns.com/services.php</a></p>
<p>In CMSB, I've changed the corresponding list field to num, as you suggested. The code I'm using to retrieve the relevant table is as follows:</p>
<p><code>  list($insets_panelsRecords, $insets_panelsMetaData) = getRecords(array(<br />     'tableName'   =&gt; 'insets-panels',<br />     'loadUploads' =&gt; true,<br />     'allowSearch' =&gt; false,<br />   ));</code></p>
<p>You advised changing this to:</p>
<p><code>  //Use getRecords to retrieve your pages data<br />   list($pages, $pagesMetaData) = getRecords(array(<br />     'tableName'   =&gt; 'pages',<br />     'where'       =&gt; whereRecordNumberInUrl(0),<br />     'loadUploads' =&gt; true,<br />     'allowSearch' =&gt; false,<br />     'limit'       =&gt; '1',<br />   ));<br />   $pages= @$pages[0]; // get first record<br />   if (!$pages) { dieWith404("Record not found!"); } // show error message if no record found<br /><br /><br />   $inset = mysql_get('inset-panels', $pages['name_of_list_field']);</code></p>
<p>Sorry, but I'm not sure which values I should be changing in your version, and what should remain untouched?</p>
<p>Also, should I be placing</p>
<p><code>&lt;?php echo $inset['title']; ?&gt; </code></p>
<p>where I want the panel to appear on the page?</p>
<p>Thanks again.</p>]]></description>
          <pubDate>Tue, 19 Mar 2013 10:49:27 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2229919#post2229919</guid>
        </item>
                <item>
          <title>Displaying dynamic content</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2229914#post2229914</link>
          <description><![CDATA[<p>Hi Nigel,</p>
<p>The easiest way to do it would be to make two separate MySQL calls to get the full data from your inset-panels:</p>
<p>First, I would change your list field so that the value that is stored is the num value for the record (see attached image).  Then your code on the page should look something like this:</p>
<p><code>  //Use getRecords to retrieve your pages data<br />  list($pages, $pagesMetaData) = getRecords(array(<br />    'tableName'   =&gt; 'pages',<br />    'where'       =&gt; whereRecordNumberInUrl(0),<br />    'loadUploads' =&gt; true,<br />    'allowSearch' =&gt; false,<br />    'limit'       =&gt; '1',<br />  ));<br />  $pages= @$pages[0]; // get first record<br />  if (!$pages) { dieWith404("Record not found!"); } // show error message if no record found<br /><br /><br />  $inset = mysql_get('inset-panels', $pages['name_of_list_field']);</code></p>
<p>This is just example code, so you'll need to make some changes to get it to work with your site.</p>
<p>So the getRecords function is being used to retrieve the general content for the page, and contains the drop down list field that allows the user to select an inset-panel. </p>
<p>The $pages['name_of_list_field] will contain the relevant num value for the record in your inset-panels section. Then the mysql_get function is used to retrieve the contents of the record from the inset-panels section.</p>
<p>The returned array will be in the same format as a getRecords array, and will contain the details of the inset-panels record. For example, you could display the title of the inset panel like this:</p>
<p><code>&lt;?php echo $inset['title']; ?&gt;</code></p>
<p>The only problem you might have is the mysql_get function doesn't return meta data (eg, images, who created the record, etc), let me know if you need that data and I'll show you the changes you need to make to get it.</p>
<p>Thanks!</p>
<p>Greg</p>]]></description>
          <pubDate>Tue, 19 Mar 2013 10:14:58 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2229914#post2229914</guid>
        </item>
                <item>
          <title>Displaying dynamic content</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2229893#post2229893</link>
          <description><![CDATA[<p>I've set up CMSB so that my client can add a series of promotional insets, such as the four seen near the bottom of this homepage: <a href="http://kathiejordandesign.com.previewdns.com/index.php" rel="nofollow">http://kathiejordandesign.com.previewdns.com/index.php</a> (Window Treatments, etc). These are stored in a table in the database called "inset-panels", which has a field called "title".</p>
<p>Is there a way that I can set up other pages in CMSB so the client can choose one inset panel from a drop down menu, and have their selection appear on other live pages? Here's a hard coded example of how I'd like that to look: <a href="http://kathiejordandesign.com.previewdns.com/services.php." rel="nofollow">http://kathiejordandesign.com.previewdns.com/services.php.</a></p>
<p>I've set up the CMSB for the Services page so that the user can choose which record in "inset-tables" they want to use (see attached), but how do I get the corresponding panel to actually appear on the page? I.e. if they choose, say, "Antiques" from the drop down menu, the corresponding Antiques panel appears on the page.</p>]]></description>
          <pubDate>Mon, 18 Mar 2013 14:00:03 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2229893#post2229893</guid>
        </item>
              </channel>
    </rss>
  