teo74 Posted April 18, 2015 Share Posted April 18, 2015 (edited) Hi all, I'm new to ProcessWire. How could I select from a list of pages (from the backend) to create a list of "similar pages"? Maybe InputfieldPageListSelectMultiple.module(?) but I cannot find any information how to use this module. Then store the list (by id?) in some field assigned to the current page to be parsed when the page is rendered and show the similar pages. Thank you!! Edited April 18, 2015 by teo74 Link to comment Share on other sites More sharing options...
Craig Posted April 18, 2015 Share Posted April 18, 2015 Hi teo74, welcome to the forum You are sort of there with InputfieldPageListSelectMultiple - but alone, that is just one method of providing the visual input part of what you need. What you need is the Page fieldtype, which will give you the option of using Page List Select inputs, amongst others, in the backend. The Fieldtype is how the data is stored, formatted and linked internally, and the Inputfield is how this field is presented and manipulated in the backend by a user. Have a look at this video - Using the Page Fieldtype - to get an idea of how it all works. In summary: Create a new field (called 'related', perhaps?) using the Page fieldtype. Configure it for the types of pages you want to select, and how you want the selector to look (which Inputfield to use) Add it to the template where you want to choose related pages. Edit those pages and choose the related pages In those pages, you can get the related ones, and display the links, by doing something like this in the template code: <ul> <?php foreach ($page->related as $relatedPage) { echo "<li><a href='{$relatedPage->url}'>{$relatedPage->title}</a></li>"; } ?> </ul> 3 Link to comment Share on other sites More sharing options...
teo74 Posted April 18, 2015 Author Share Posted April 18, 2015 Wow, thank you Craig for the fast and good answer! For those like me new to ProcessWire is really important get help when we're stucked. I really appreciate it !! Again, thank you very much ! 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