Need Some Help
6 posts by 3 authors in: Forums > CMS Builder
Last Post: July 16, 2010 (RSS)
By (Deleted User) - July 14, 2010
Re: [jda] Need Some Help
By Jason - July 15, 2010
Yes, this is possible and doesn't take much code to do. So, just to make sure I understand, you want to have your page to show the first 20 obits for that year, and then have a link to "show older", which takes them to a page which would show all of the obits for that year that are past the first 20?
Is that right?
Also, if you could attach the current .php page that you're working with, I can give you much more specific instructions on how to do this.
Hope this helps.
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Jason] Need Some Help
By (Deleted User) - July 15, 2010
Re: [jda] Need Some Help
By Jason - July 15, 2010 - edited: July 16, 2010
Okay. For the link to view older obituaries, you can use something like this:
<a href="newslist-1.php?older=1">View Older Obituaries</a>
Then we just need to change how we select the records up at the top of the page. Try this:
if(@$_REQUEST['older']){
list($obits1Records, $obits1MetaData) = getRecords(array(
'tableName' => 'obits1',
'offset' => 20,
));
}
else{
list($obits1Records, $obits1MetaData) = getRecords(array(
'tableName' => 'obits1',
'limit' => '20',
));
}
What this does is that if the user clicks on the link to view the older obits, the script selects all the records that come after the 20th record. If the link hasn't been clicked, it selects the first 20.
Give this a try and let me know if you run into any problems.
Hope this helps.
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Jason] Need Some Help
By affinitymc - July 16, 2010 - edited: July 16, 2010
Cheers
Brian
Re: [affinitymc] Need Some Help
By Jason - July 16, 2010
Thanks for catching the "odler" mistake.
'offset' => 20
would work, since the offset can be evaluated as a number and not a string, but either would be fine.
Thanks.
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/