Hi,
> I have products that habtm categories. Although a product can belong
> to many categories, only one of those associations is condifered the
> 'main' category. To get around this issue I'm using the 'with'
> association. I have this working fine.
>
> The problem I have is when I'm on a particular product view page, I
> need next/previous links, but find('neighbours') doesn't work with
> habtm's, at least, I've not had any luck so far.
I've found a fix for this, it's a bit crude, but works:
for belongsTo related models, conditions and custom ordering:
http://blog.jben.net/post/125792157/long-winded-replacement-for-find-neighbours
for habtm with extra join data, conditions and ordering:
http://blog.jben.net/post/125820619/replacement-for-find-neighbours-when-dealing-with-habtm
Neither of these are ideal in anyway, so would welcome suggestions for
improvements.
Cheers,
Jon
--
jon bennett
w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---