I have a view with Infinite Scroll Pager giving me the latest products of the website.
Every taxonomy term has an image attatched on it.
I want to display taxonomy terms every 3 rows of products.
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.
Sign up to join this communityI have a view with Infinite Scroll Pager giving me the latest products of the website.
Every taxonomy term has an image attatched on it.
I want to display taxonomy terms every 3 rows of products.
I think you must alter the view.
Create the views normally, add taxo to every rows.
Use the Hook hook_views_pre_render(&$view)
Delete the term for every rows except 1/3.
For example something like this:
function MYMODULE_views_pre_render(&$view) {
if ($view->name == 'view_myviewname') {
$result = $view->result;
$count = 0;
foreach ($result as $i => $row) {
if(!$count % 3){
unset($view->result[$i]->field_MYTEXONOMYFIELD[0]);
}
$count++;
}
}
}
Example from : http://www.drupal8.ovh/en/tutoriels/238/alter-a-view-edit-view-result-programmatically