Multiple Viewers of same content with variation

3 posts by 3 authors in: Forums > CMS Builder
Last Post: August 17, 2008   (RSS)

Re: [benedict] Multiple Viewers of same content with variation

By Kenny - August 17, 2008

Try making the most read articles a separate page - then do a "php includes" on the page you wish to display the data on.

The two are going to conflict by using the same "top of page code" but by making them two separate pages, with two different "top of page code" it may work.

Re: [sagentic] Multiple Viewers of same content with variation

By Jake - August 17, 2008

Hi benedict,

Thanks for your post!

Sagentic's method will work, and would help to keep your files organized a bit. There is another method available though, which is to change the names of the variables used in your "STEP 1" code. Take this code for example:

<?php

require_once "/path/to/lib/viewer_functions.php";

list($newsRecords, $newsMetaData) = getRecords(array(
'tableName' => 'news',
'limit' => '1',
));

?>


If you wanted to display the same content differently, you could rename the variables and append it like this:

<?php

require_once "/path/to/lib/viewer_functions.php";

list($newsRecords, $newsMetaData) = getRecords(array(
'tableName' => 'news',
'limit' => '1',
));

list($newsHeadlineRecords, $newsHeadlineMetaData) = getRecords(array(
'tableName' => 'news',
'limit' => '5',
));

?>


You would then adjust the second set of list code used later in the page to match the variable names you used there.

Feel free to contact us if you have any further questions about this. [:)]
-----------------------------------------------------------
Cheers,
Jake Marvin - Product Specialist
support@interactivetools.com

Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.