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

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! :)
Dave Edis - Senior Developer
interactivetools.com

Re: [zaba] Prev/Next links on a Detail page?

By Dave - October 12, 2012

Try replacing this:
'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

By zaba - October 12, 2012

Thanks Dave, perfect!!!
and thanks for the explanation, always helps :-)