A
A
Alexander Ivanov2016-10-12 17:56:09
MODX
Alexander Ivanov, 2016-10-12 17:56:09

How to display one value in getimagelist?

getImageList has &where and &value parameters, I think that through one of them it is possible, but so far I have not seen any examples.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Ivanov, 2016-10-12
@cimonlebedev

I think it will be given to someone:
mycode.in.ua/modx/typical-ex/migx-package
output from getImageList one by one additional snippet: Snippet
name "migxitem"

$tpl = 'tpl.ParallaxBanner';
if (isset($options)){
  $options = explode('&tpl=',$options);
  $key = intval($options[0]) - 1;
  $tpl = $options[1];
}else{
  $key = 0;
}
$data = $modx->fromJSON($input);
$data = $data[$key];
$output = $modx->getChunk($tpl,$data);
return $output;

Calling the snippet:
I needed it when I didn’t want to reverse after the tilde, and it was easier to stuff it one by one, or write a bunch of conditions in chunks.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question