tooth-paste Posted June 28, 2018 Share Posted June 28, 2018 I have build an agenda with repeater. Now I would like to show three recent items(limit=3) on the homepage but can not get it to work. I've tried several things like, pages, get, find template. system template(setup->temp->filter): repeater_agendaitem Original code on agenda page(works perfect): if(count($page->agendaitem)) { $today = strtotime("today"); $upcoming_dates = $page->agendaitem->find("agenda_datum>=$today, sort=agenda_datum"); if(count($upcoming_dates)) { foreach($upcoming_dates as $upcoming_date) { echo "<h4>{$upcoming_date->agenda_activiteit}</h4><p> <b>{$upcoming_date->agenda_datum} {$upcoming_date->agenda_tijd}</b><br /> {$upcoming_date->agenda_beschrijving} </p> <div class='stippellijnzwart'></div>"; } } } Link to comment Share on other sites More sharing options...
Klenkes Posted June 28, 2018 Share Posted June 28, 2018 To get the repeateritems when they do not live on the current page, you do: $upcoming_dates = $pages->get(ID-of-repeaterpage)->agendaitem->find("agenda_datum>=$today, sort=agenda_datum"); and you go from there. 5 Link to comment Share on other sites More sharing options...
tooth-paste Posted June 28, 2018 Author Share Posted June 28, 2018 FANTASTIC! Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now