We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31410
    • 66 Posts
    hi
    i am confused a lot by seeing this code in gallery snippet

    $item->get(’thumbnail’,array(
    ’w’ => (int)$modx->getOption(’thumbWidth’,$scriptProperties,100),
    ’h’ => (int)$modx->getOption(’thumbHeight’,$scriptProperties,100),
    ’zc’ => (boolean)$modx->getOption(’thumbZoomCrop’,$scriptProperties,1),
    ’far’ => (boolean)$modx->getOption(’thumbFar’,$scriptProperties,’C’),
    ));
    there is no thumbnail filed in itemTable
    but how you are able to assign this?

    can you explain me how its worked

    checked the public function get($k, $format = null, $formatTemplate= null) function too
    spent a lot of time on finding the magic behind it but no luck

    please please explain how u did it iam very curious about it tongue

    thanks
    venu
      • 21257 MODX Staff
      • 730 Posts
      galItem->get() (in galitem.class.php) is where the magic is. The first case in the switch statement is what handles get(’thumbnail’).
      It’s a good example of how easy it is to override an xPDOObject, or in this case, xPDOSimpleObject, so that get() can return things other than db fields.
        Mike Schell
        Lead Developer, MODX Cloud
        Email: [email protected]
        GitHub: https://github.com/netProphET/
        Twitter: @mkschell