fmgujju Posted May 4, 2013 Posted May 4, 2013 I have created Page field type and set as Multiple pages (PageArray) option under details and set Input as "template of the pages" (template-X). I am using this PageFieldType on other template (template-Y) to select multiple pages by providing checkbox. I created some pages with template-X and selected some of those pages on the template-Y page. I can able to display selected pages on the template-Y page on the front-end but I want to display all of the pages created by template-X on the template-Y page with flag that can tell which one was selected and which one don't. I was able to display only selected pages list and all of the template-X pages on template-Y separately. If its unclear then please let me know. Thanks!
Wanze Posted May 4, 2013 Posted May 4, 2013 Something like this? $allPages = $pages->find('template=template-X'); $selectedPages = $page->pagesWithTemplateX; foreach ($allPages as $p) { $selected = ($selectedPages->has($p)) ? 'selected' : 'not selected'; echo $p->title . " is {$selected}"; } 2
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