Oxid version is 4.9.5 currently (local dev. Will be updated before going live).
Is it me or does smarty miss quite a few functions in oxid? For instance, today I ran into a CSS-Problem that leaves me no choice but to add “phantom” elements to fill a container.
It concerns a responsive flexbox container with margins between the items. Basically I need X% + Ypx per item. I have exhausted all options in CSS, since calc()-ing the margin doesn’t work properly in IE.
So I have to loop for X-times, inserting X empty flex-items. X is known so I thought no problem, I’ll just do a for-loop. But apparently the Oxid-version of smarty doesn’t know about for-loops. Or even while-loops. Is there some alternative?
I’ve also noticed several times in the past that functionality mentioned in the official smarty docs simply doesn’t exist in oxid. Though I can’t give an example right now, since I usually could work around it somehow.
The only solution I can think of right now would be putting a custom function in oxcmp_utils that takes an integer and returns an array with that number of elements so I can use a foreach-loop in smarty. But that would be way beyond ugly. Surely there is a better solution?
[Edit]
For now, I used this function in oxcmp_utils to get around the problem:
public function getArrayOfSize($i = 0) {
return array_fill(0, $i, NULL);
}
I feel really [I]really[/I] dirty using this, so a better way would be much appreciated.