 | |  |
 |

benedict
User
Aug 16, 2008, 4:21 AM
Post #1 of 3
(2632 views)
Shortcut
|
|
Multiple Viewers of same content with variation
|
Can't Post
|
|
Hi guys, Love the CMS - really seeing it as becoming a corner stone of what we do. But I have a problem. It relates to an articles section I am presenting as a sidebar on my page. The first list viewer presents the 3 most recent articles posted to the articles table, which works fine. Beneath this, I am attempting to put in a second list viewer that also presents 3 articles, but this time it is only presenting articles that have been ticked as "Most Read" in the articles table. I have pasted the code at the top of the page and the logic is all correct, but when I paste in the code in the second sidebar section ("Most Read Articles") it presents exactly the same info. Looking at the code, it is identical to the code that appears in the first sidebar, so I can see why it is presenting the same info. How do I get it to present the "Most Read" data? To see the issue, please visit www.bir.net.au/articleDetailBIR.php Thanks.
|
|
|  |
 |

sagentic
User

Aug 17, 2008, 12:59 AM
Post #2 of 3
(2586 views)
Shortcut
|
|
Re: [benedict] Multiple Viewers of same content with variation
[In reply to]
|
Can't Post
|
|
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.
|
|
|  |
 |

Jake
Staff
/ Moderator

Aug 17, 2008, 6:43 PM
Post #3 of 3
(2549 views)
Shortcut
|
|
Re: [sagentic] Multiple Viewers of same content with variation
[In reply to]
|
Can't Post
|
|
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 /* STEP 1: LOAD RECORDS - Copy this PHP code block to the TOP of your page BEFORE anything else. */ 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 /* STEP 1: LOAD RECORDS - Copy this PHP code block to the TOP of your page BEFORE anything else. */ 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 Swanson - 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.
|
|
|  |
 | |  |
|