WBCE CMS – Way Better Content Editing.
You are not logged in.
Pages: 1
I'm not exactly sure how the oneforall_helpers snippets work, but is it possible to show a random item from a OFA section on a different page.
For example, you have three OFA pages with 10 shop items each (each page is a different Group field).
On the home page, you show three items, one from each page. Random item showing with each page refresh. If random is not an option, then just showing the latest, or a specific group from each page, perhaps group ="Featured_Items".
Offline
I guess it's not the best solution regarding efficience and performance, but here's an idea based on ofa_anyitems:
1) change
$output = '';
to
$output = array();
2) change
$output .= trim(str_replace($search, $replace, $setting_item_loop));
to
$output[] = trim(str_replace($search, $replace, $setting_item_loop));
3) change
echo $output;
to
shuffle($output);
echo $output[1];
Explanation: instead of displaying $output immediately, it is written to an array. The PHP command "shuffle" reorders the array elements randomly, so $output[1] changes each time when the function is called.
Btw, just call the function with the OfA section ID as the only parameter, e.g.
oneforall_anyitems(17);
Sorgen sind wie Nudeln: man macht sich meist zu viele.
Offline
Thank you. I'll give that a try.
Offline
Pages: 1