Prev/Next links on a Detail page?
15 posts by 6 authors in: Forums > CMS Builder
Last Post: October 12, 2012 (RSS)
By dougdrury - June 24, 2009
Dave,
Perfect-o!
I put the first line in.
$errors = '';
But left the die part out because it was failing on the 'recordNum' error. It is working as I need it, so I just needed to instantiate $errors to get the warning to go away.
Thank you as always for your great support!
Doug
Perfect-o!
I put the first line in.
$errors = '';
But left the die part out because it was failing on the 'recordNum' error. It is working as I need it, so I just needed to instantiate $errors to get the warning to go away.
Thank you as always for your great support!
Doug
Re: [dougdrury] Prev/Next links on a Detail page?
By Dave - June 24, 2009
Ok, you may need recordNum to tell it which record to get the prev & next records for, but if it's working as is - great!
Glad to help! :)
Glad to help! :)
Dave Edis - Senior Developer
interactivetools.com
interactivetools.com
By zaba - October 12, 2012
Hi, This works for me, only on the first page (when there is no number in the url) the next link does not display. How would I get this to display? it only works if I put mypage.php?1, but not if i put mypage.php.
Re: [zaba] Prev/Next links on a Detail page?
By Dave - October 12, 2012
Try replacing this:
With this:
That's a "ternary operator", a short way of writing an if/else block. It means: if getNumberFromEndOfUrl() returns a value, use getNumberFromEndOfUrl(), otherwise use 1.
Let me know if that works for you.
'recordNum' => getNumberFromEndOfUrl(),
With this:
'recordNum' => getNumberFromEndOfUrl() ? getNumberFromEndOfUrl() : 1,
That's a "ternary operator", a short way of writing an if/else block. It means: if getNumberFromEndOfUrl() returns a value, use getNumberFromEndOfUrl(), otherwise use 1.
Let me know if that works for you.
Dave Edis - Senior Developer
interactivetools.com
interactivetools.com