<?xml version="1.0" encoding="UTF-8"?>    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
      <channel>
        <title>News section categories record display on different page.</title>
        <link>https://interactivetools.com/forum/forum-posts.php?News-section-categories-record-display-on-different-page_-78684</link>
        <description></description>
        <pubDate>Fri, 15 May 2026 04:19:40 -0700</pubDate>
        <language>en-us</language>
        <atom:link href="https://interactivetools.com/forum/forum-posts.php?rss=1&amp;News-section-categories-record-display-on-different-page_-78684" rel="self" type="application/rss+xml" />

                <item>
          <title>News section categories record display on different page.</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2230339#post2230339</link>
          <description><![CDATA[<p>Hi Jac,</p>
<p>As there are three different links that the section can be used for, you're going to have to abandon the <em>_link</em> system and manually encode them  instead, but this is fairly straightforward to do. Here is an example using your news system:</p>
<p><code>&lt;a href="/newsdetail.php?&lt;?php echo urlencode($record['title']).'-'.$record['num']; ?&gt;"&gt;&lt;?php echo $record['title'] ?&gt;&lt;/a&gt;&lt;br/&gt;</code></p>
<p>The link goes to the newsdetail.php page, and I've URL encoded the title and added the record number into the link. I've also added the title to the link text. </p>
<p>I also changed the getRecord function on your detail page so that it would retrieve the article that is in the url:</p>
<p><code>  // load record from 'news'<br />  list($newsRecords, $newsMetaData) = getRecords(array(<br />    'tableName'   =&gt; 'news',<br /><span style="color:#008000;">    'where'       =&gt; whereRecordNumberInUrl(0), // load first record</span><br />    'loadUploads' =&gt; true,<br />    'allowSearch' =&gt; false,<br />    'limit'       =&gt; '1',<br />  ));</code></p>
<p>The link back to the list page on the detail page should look something like this:</p>
<p><code>&lt;a href="/newslist.php"&gt;&amp;lt;&amp;lt; Back to list page&lt;/a&gt;</code></p>
<p>So the back link just points back to the newslist page. </p>
<p>If you want to use these links in your other pages (e.g. announcements), you'd just copy the code above and change the php pages they link too.</p>
<p>Let me know if you have any questions.</p>
<p>Cheers!</p>
<p>Greg</p>]]></description>
          <pubDate>Tue, 23 Apr 2013 09:51:12 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2230339#post2230339</guid>
        </item>
                <item>
          <title>News section categories record display on different page.</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2230333#post2230333</link>
          <description><![CDATA[<p>Hi Jac,</p>
<p>If I understand you correctly, only the record that is selected in the list page will be the one that appears on the detail page.</p>
<p>So, if  an Announcement listing is selected on the list page then that is the one that will show on the detail page.</p>
<p>And, if a record for a conference listing is selected, then the conference listing will be the one shown on the detail page.</p>
<p>Jerry Kornbluth</p>]]></description>
          <pubDate>Tue, 23 Apr 2013 05:26:20 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2230333#post2230333</guid>
        </item>
                <item>
          <title>News section categories record display on different page.</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2230331#post2230331</link>
          <description><![CDATA[<p>Hi Gerg</p>
<p>One problem is </p>
<p>There are 3 news categories on the NEWS section.</p>
<p>The section only can set one URL  -  newsList.php and newsDetail.php.</p>

<p>When I generate the code page for Announcement page.  It will go to newslist.php</p>

<p>I would like to create </p>
<p>"AnnouncementsList.php" &amp; "AnnouncementsDetail.php" to display the Announcements news only.</p>
<p>&amp; </p>
<p>"<span>ConferencesList.php" &amp; "<span>ConferencesDetail.php"  to display the Conferences news only.</span></span></p>
<p>It all belong to NEWS section.</p>

<p>The attachment is the news categories code.</p>

<p>Hope you can understand the meaning.</p>
<p>Could you kindly help this?</p>

<p>Thanks a lot!</p>

<p>Jac</p>



]]></description>
          <pubDate>Mon, 22 Apr 2013 23:50:24 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2230331#post2230331</guid>
        </item>
                <item>
          <title>News section categories record display on different page.</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2230318#post2230318</link>
          <description><![CDATA[<p>Hi Jac</p>
<p>You can set the list page and detail page URL's in the CMS admin area. If you go the the section editors menu, then click the modify link on the section you want to edit, then go to the viewer URLs tab, you can set which list and detail page URL's you want. These will then be stored in the sections meta data and _link field.</p>
<p>What is the issue you're having with the e-mail this page link? I did a quick test and it seemed to work correctly for me. </p>
<p>Thanks!</p>
<p>Greg</p>]]></description>
          <pubDate>Mon, 22 Apr 2013 12:14:01 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2230318#post2230318</guid>
        </item>
                <item>
          <title>News section categories record display on different page.</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2230313#post2230313</link>
          <description><![CDATA[<p>Hi Gerald</p>
<p><span>I created a News section. </span> There are 3 categories for this section.</p>
<p>1) News Press<br />2) Announcements<br />3) Conferences</p>
<p>I add the code on page Header to get the Announcements record.</p>
<blockquote>
<p>'where' =&gt; " category = 'Announcements' "</p>
</blockquote>
<p>and there are 2 pages "announcementsList.php" &amp; "announcementsDetail.php"</p>

<p>Now I got problem in "_link".  How can I get correct detail page to link in</p>
<blockquote>
<p>_link : &lt;a href="&lt;?php echo $record['_link'] ?&gt;"&gt;&lt;?php echo $record['_link'] ?&gt;&lt;/a&gt;&lt;br/&gt;</p>
</blockquote>
<p>also How can I get the correct "Back to list page" , "Email this page" URL?</p>
<blockquote>
<p>&lt;a href="&lt;?php echo $newsMetaData['_listPage'] ?&gt;"&gt;&amp;lt;&amp;lt; Back to list page&lt;/a&gt; &lt;a href="mailto:?subject=&lt;?php echo urlencode(thisPageUrl()) ?&gt;"&gt;Email this Page&lt;/a&gt;&lt;/td&gt;</p>
</blockquote>
<p>Now all get errors.</p>

<p>Thanks a lot for the help!</p>

<p>Jac</p>


]]></description>
          <pubDate>Mon, 22 Apr 2013 10:49:54 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2230313#post2230313</guid>
        </item>
                <item>
          <title>News section categories record display on different page.</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2230310#post2230310</link>
          <description><![CDATA[<p>Hi Jerry</p>
<p>I found the solution.  </p>
<p>but got problem in "&lt;&lt; Back to list page" &amp;  "Email this Page"</p>
<p>My Header code</p>
<blockquote>
<p>&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/httpd/vhosts/kwbs.org.tw/httpdocs/web/','','../','../../','../../../');<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."); }</p>
<p>// load record from 'news'<br /> list($newsRecords, $newsMetaData) = getRecords(array(<br /> 'tableName' =&gt; 'news',<br /> 'where' =&gt; "category = 'announcements'",<br /> 'loadUploads' =&gt; true,<br /> 'allowSearch' =&gt; false,<br /> 'limit' =&gt; '1',<br /> ));<br /> $newsRecord = @$newsRecords[0]; // get first record<br /> if (!$newsRecord) { dieWith404("Record not found!"); } // show error message if no record found</p>
<p>?&gt;</p>
</blockquote>
<p>Body code</p>
<blockquote>
<p>&lt;h1&gt;Detail Page Viewer&lt;/h1&gt;<br />category (value): &lt;?php echo $newsRecord['category'] ?&gt;&lt;br/&gt;<br />Title: &lt;?php echo htmlencode($newsRecord['title']) ?&gt;&lt;br/&gt;<br />Content: &lt;?php echo $newsRecord['content']; ?&gt;&lt;br/&gt;<br /><br />&lt;hr/&gt;</p>
<p>&lt;a href="&lt;?php echo $newsMetaData['_listPage'] ?&gt;"&gt;&amp;lt;&amp;lt; Back to list page&lt;/a&gt; &lt;a href="mailto:?subject=&lt;?php echo urlencode(thisPageUrl()) ?&gt;"&gt;Email this Page&lt;/a&gt;&lt;/td&gt;</p>
</blockquote>
<p><span>Thanks in advance for your help.</span></p>
<p>Jac.</p>]]></description>
          <pubDate>Mon, 22 Apr 2013 09:44:45 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2230310#post2230310</guid>
        </item>
                <item>
          <title>News section categories record display on different page.</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2230309#post2230309</link>
          <description><![CDATA[<p>What code are you using for detail page?</p>
<p>Jerry Kornbluth</p>]]></description>
          <pubDate>Mon, 22 Apr 2013 05:22:51 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2230309#post2230309</guid>
        </item>
                <item>
          <title>News section categories record display on different page.</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2230305#post2230305</link>
          <description><![CDATA[<p>Hi Gerg</p>
<p>It is nice and no problem for List page record.    </p>
<p>But got problem with getting announcements on Detail page.</p>
<p>I have created announcementsList.php &amp; announcementsDetail.php page now.</p>
<p>Here is my code now(List page):</p>
<blockquote>
<p>&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/httpd/vhosts/kwbs.org.tw/httpdocs/web/','','../','../../','../../../');<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."); }</p>
<p>// load records from 'news'<br /> list($newsRecords, $newsMetaData) = getRecords(array(<br /> 'tableName' =&gt; 'news',<br /> 'where' =&gt; "category = 'announcements'",<br /> 'loadUploads' =&gt; true,<br /> 'allowSearch' =&gt; false,<br /> 'orderBy' =&gt; 'category ASC'<br /> ));<br />?&gt;</p>
</blockquote>
<p>Body</p>
<blockquote>
<p>&lt;table width="85%" border="0" align="center" cellpadding="0" cellspacing="0"&gt;<br /> &lt;tbody&gt;<br /> &lt;tr&gt;<br /> &lt;td width="70%" align="left" class="line_h_double_brown_bottom"&gt;&lt;img hspace="10" <br /> alt="Latest News" vspace="7" <br /> src="images/index/title_news.gif" <br /> width="97" height="14" /&gt;&lt;/td&gt;<br /> &lt;td width="30%" align="right" valign="bottom" class="line_h_double_brown_bottom"&gt;&lt;a href="index.html"&gt;&lt;img <br /> class="banner_line_no" hspace="5" alt="More News!" vspace="9" <br /> src="images/share/button_more.gif" /&gt;&lt;/a&gt;&lt;/td&gt;<br /> &lt;/tr&gt;<br /> &lt;tr&gt;<br /> &lt;td valign="top" colspan="2" align="right"&gt;<br /> &lt;?php foreach ($newsRecords as $record): ?&gt;<br /> &lt;div&gt;<br /> &lt;ul&gt;<br /> &lt;li&gt;&lt;?php echo date("Y-m-d", strtotime($record['date'])) ?&gt; | &lt;a href="&lt;?php echo $record['_link'] ?&gt;"&gt;&lt;?php echo htmlencode($record['title']) ?&gt;&lt;/a&gt;&lt;/li&gt;<br /> &lt;/ul&gt;<br /> &lt;/div&gt;<br /> &lt;?php endforeach ?&gt;<br /> &lt;?php if (!$newsRecords): ?&gt;<br /> No records were found!<br /> &lt;?php endif ?&gt;<br /> &lt;hr /&gt;&lt;/td&gt;<br /> &lt;/tr&gt;<br /> &lt;/tbody&gt;<br /> &lt;/table&gt;</p>
</blockquote>
<p>need help!</p>
<p>Thanks a lot!</p>
<p>Jac </p>]]></description>
          <pubDate>Sun, 21 Apr 2013 22:54:40 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2230305#post2230305</guid>
        </item>
                <item>
          <title>News section categories record display on different page.</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2230276#post2230276</link>
          <description><![CDATA[<p>HI Gerald and Greg</p>
<p>Trying now.</p>
<p>Thanks a lot!</p>
<p>Jac</p>]]></description>
          <pubDate>Thu, 18 Apr 2013 10:21:49 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2230276#post2230276</guid>
        </item>
                <item>
          <title>News section categories record display on different page.</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2230275#post2230275</link>
          <description><![CDATA[<p>Hi Jac,</p>
<p>Just thought I'd extend on Jerrys answer by adding that you can sort the items by the category name in your getRecords array like this:</p>
<p><code>  // load records from 'blog'<br />  list($($news_1Records, $($news_1RecordsMetaData) = getRecords(array(<br />    'tableName'   =&gt; 'blog',<br />    'loadUploads' =&gt; true,<br />    'allowSearch' =&gt; false,<br /><span style="color:#339966;">    'orderBy'     =&gt; 'category ASC'</span><br />  ));<br /></code></p>
<p>You should just need to copy the green orderBy item above and add it to your getRecords array.</p>
<p>This will make it so that the returned items will be sorted by the category field in alphabetical order.</p>
<p>Let me know if you have any questions.</p>
<p>Thanks!</p>
<p>Greg</p>]]></description>
          <pubDate>Thu, 18 Apr 2013 10:06:48 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2230275#post2230275</guid>
        </item>
                <item>
          <title>News section categories record display on different page.</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2230273#post2230273</link>
          <description><![CDATA[<p>Hi Jac,</p>
<p>For the Announcements category you could try a where statement in the list records call for the Announcement viewer</p>
<p><span><code><span style="color:#000000;">'where' =&gt; " category = 'Announcements' " </span></code></span></p>
<p>Or you could try an if statement inside the foreach loop:</p>
<p><code>&lt;?php foreach ($news_1Records as $record): ?&gt;<br /><br /> &lt;?php if($record['category'] == 'Announcements') : ?&gt;<br /><br /><br /> The rest of your code...<br /><br /><br /> &lt;?php endif ?&gt;<br /><br /><br /> &lt;?php endforeach ?&gt;</code></p>
<p>Then change the criteria for the other viewers as appropriate</p>
<p>Hope that helps you,</p>
<p>Gerald Kornbluth</p>]]></description>
          <pubDate>Thu, 18 Apr 2013 08:37:26 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2230273#post2230273</guid>
        </item>
                <item>
          <title>News section categories record display on different page.</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2230272#post2230272</link>
          <description><![CDATA[<p>Hi </p>
<p>I created a News section.  There are 3 categories for this section.</p>
<p>1) News Press<br />2) Announcements<br />3) Conferences</p>
<p>That is no problem to display 3 categories on one page.</p>
<p>But I also want the 3 different news category display on it own page. also I can sort it.</p>
<p>How to do it?</p>
<p>Here is my code for the news section.</p>
<blockquote>
<p>&lt;?php foreach ($news_1Records as $record): ?&gt;<br />Record Number: &lt;?php echo htmlencode($record['num']) ?&gt;&lt;br/&gt;<br />date: &lt;?php echo date("D, M jS, Y g:i:s a", strtotime($record['date'])) ?&gt;&lt;br/&gt;&lt;!-- For date formatting codes see: <a href="http://www.php.net/date" rel="nofollow">http://www.php.net/date</a> --&gt;<br />category (value): &lt;?php echo $record['category'] ?&gt;&lt;br/&gt;<br />category (label): &lt;?php echo $record['category:label'] ?&gt;&lt;br/&gt;<br />Title: &lt;?php echo htmlencode($record['title']) ?&gt;&lt;br/&gt;<br />Content: &lt;?php echo $record['content']; ?&gt;&lt;br/&gt;<br />_link : &lt;a href="&lt;?php echo $record['_link'] ?&gt;"&gt;&lt;?php echo $record['_link'] ?&gt;&lt;/a&gt;&lt;br/&gt;<br />&lt;hr/&gt;<br />&lt;?php endforeach ?&gt;</p>
</blockquote>
<p>Thanks a lot!</p>

<p>Jac</p>]]></description>
          <pubDate>Thu, 18 Apr 2013 07:07:06 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2230272#post2230272</guid>
        </item>
              </channel>
    </rss>
  