First, passing 'product.id' to the parent_id param isn't going to work unless you have a field literally named "parent.id" in your images table. Second, unless you are going to relate images to each other using a parent->child structure you do not need a tree - and using the tree behavior for sequencing is silly when you can find a number of sequencing behaviors on github if you bother looking.
https://github.com/guavadesign/CakePHP-Orderable-Behaviour/blob/master/models/behaviors/orderable.php https://github.com/neilcrookes/sequence On Jul 20, 10:38 pm, adamn318 <[email protected]> wrote: > Hi all, > > I have tried my hardest to search the web in reference to this > particular topic, but have unfortunately gotten no where. Basically > what I would like to do is have a similar behaviour to a tree, with > the left and right reference columns to control the position of an > image entry in a table. Now for each image it is linked to a > product_id which is obviously in another table, which is effectively > the parent_id. Is there a way to use a tree an trick it into > performing this behaviour behind the scenes? If not, or if it isn't > recommended, could someone please point me in the direction of how I > can set up this ordered behaviour. > > One method I did try was to do the following: > > var $actAs = array('Tree' => array('parent_id' => 'product.id')); > > which allows me to add images, but the lft and rght field don't > update. > > In short, what im trying to do is be able to have a list of images on > the admin side, that I can reorder simply. If I'm completely off > target with how I am going about this, please let me know. > > Any help would be much appreciated. > > Adam -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
