Blended List View from Multiple Sections

7 posts by 4 authors in: Forums > CMS Builder
Last Post: August 12, 2009   (RSS)

By zip222 - August 11, 2009

I am looking to have a blended list of items on the home page of a site. These items would be pulled from three separate sections of the CMS and would be ordered by date. Any ideas on how this could be achieved?

Re: [jdancisin] Blended List View from Multiple Sections

jdancisin

Actually, its fairly simple. Create your 3 sections in CMSB, then generate the code for the first one. Paste the "Step 1" code at the top of your php file (example 1):

<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php

require_once "/your/home/directory/cmsbuilder/lib/viewer_functions.php";

list($ipac_articlesRecords, $ipac_articlesMetaData) = getRecords(array(
'tableName' => 'ipac_articles',
'perPage' => '3',
));

?>


Generate the code for the second section and paste only the actual record definition. Do the same for the third (Example 2):

<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
require_once "/your/home/directory/cmsbuilder/lib/viewer_functions.php";

list($ipac_articlesRecords, $ipac_articlesMetaData) = getRecords(array(
'tableName' => 'ipac_articles',
'perPage' => '3',
));

list($ipac_menuRecords, $ipac_menuMetaData) = getRecords(array(
'tableName' => 'ipac_menu',
'loadUploads' => '0',
'allowSearch' => '0',
));
list($ipac_categoriesRecords, $ipac_categoriesMetaData) = getRecords(array(
'tableName' => 'ipac_categories',
'loadUploads' => '0',
'allowSearch' => '0',
));

?>


Note that the "require" statement is only required once.

Then, you can add the code to display the records as required.

Straight forward once you've done it a couple of times!

Good luck! [:)]
--
northernpenguin
Northern Penguin Technologies

"Any sufficiently advanced technology
is indistinguishable from magic."
........Arthur C. Clarke

Re: [aev] Blended List View from Multiple Sections

By zip222 - August 12, 2009

That is correct. This will get me three different viewers on one page, but not a list that blends the listings together.

Re: [jdancisin] Blended List View from Multiple Sections

By aev - August 12, 2009

I saw your post when searching for a solution to the same problem. I also posted a similar question, my post is here:

http://www.interactivetools.com/iforum/Products_C2/CMS_Builder_F35/Records_from_multiple_sections_into_one_viewer_P73668/

Re: [aev] Blended List View from Multiple Sections

Hi jdancisin:

Looks like I misunderstood what you meant by "blended". Do you mean all the records from Field1, then all the records from Field2, then all the records from Field3 in order by creation date?
--
northernpenguin
Northern Penguin Technologies

"Any sufficiently advanced technology
is indistinguishable from magic."
........Arthur C. Clarke

Re: [northernpenguin] Blended List View from Multiple Sections

By Chris - August 12, 2009 - edited: August 13, 2009

Hi jdancisin,

I've just posted a response to aev with a How-To in the following thread:

http://www.interactivetools.com/forum/gforum.cgi?post=73679#73679

Please let us know if that doesn't help solve your problem!
All the best,
Chris