Tagged: partner/logo
I have used the code here: https://kriesi.at/support/topic/randomize-partnerlogo/ to randomize the logos, and it works well. However, I have a few questions.
I think this can be done, but I know just enough PHP to get myself into trouble. I would like to randomize the logos on the slider, but not the grid. Is that possible? I would think
if($config['type'] == 'slider') shuffle($this->id_array);
would do it, but I couldn’t get it to work. What am I missing?
Also, on the grid, the links aren’t following the logos. Meaning, I have a page with the partner/logo element configured for a grid, and the links aren’t following the logos, they are staying at the alphabetically sorted location. Thoughts? Fixes?
Thanks,
-jeff
Hi jeffstrahl!
Try:
if($this->config['type'] == 'slider')
{
$aux = array();
$keys = array_keys($this->id_array);
shuffle($keys);
foreach($keys as $key) {
$aux[$key] = $this->id_array[$key];
unset($this->id_array[$key]);
}
$this->id_array = $aux;
}
Regards,
Peter
Hey Peter,
Thanks for that, it worked perfectly, in regards to random slider, but static grid. Nice!
Now, the only other challenge to this riddle is the links following the right logos. On the slider (that’s now been randomized), the links are not on the respective logo. They obviously match on the grid, since it’s static, but not on the randomized slider.
Thoughts?
Thanks,
-jeff
Hi!
I updated the code a bit – it should work now :)
Regards,
Peter
Works perfectly.
I really appreciate the quick response and help.
Thanks,
-jeff