Jonathan Lahijani Posted January 4, 2016 Share Posted January 4, 2016 A Page field allows you to add multiple pages to the field (given the right settings... Multiple Pages + ASM Select). You can also add a new Page from a Page field (assuming you've allowed that option on the field) and have it assigned to this Page field, or any other Page field. A PageTable field allows you to do the same as a Page field as I described, however if you create a Page from a PageTable field, it can only be assigned to that PageTable field... meaning Pages created from a PageTable field are not "portable" like pages created from a Page field. You can't add a page that was already created to a PageTable field (I'm not considering the edge-case whereby the pages are coming from children, which PW handles already). The nice thing about a PageTable field is its presentation capabilities which a Page field doesn't have. A Page field only has the "Custom format" labeling options, which although nice, is not as appealing as PageTable. If you want the portability of new created pages that a Page field gives you, but with the presentational capabilities of a PageTable field, that doesn't seem to exist. So, to summarize the above, should Page fields be able to have an option to present themselves like how PageTables do? 1 Link to comment Share on other sites More sharing options...
kixe Posted January 4, 2016 Share Posted January 4, 2016 Workaround:https://processwire.com/talk/topic/11757-page-add-comfort-option/?p=109306 Link to comment Share on other sites More sharing options...
LostKobrakai Posted January 4, 2016 Share Posted January 4, 2016 Reusing existing pages in pagetables is also possible when using the api. There's just no interface for that, but you could create something like kixe mentioned, but the other way around: add the page chosen in a page field to the pagetable. Link to comment Share on other sites More sharing options...
bernhard Posted January 5, 2016 Share Posted January 5, 2016 hi jonathan, i like the idea because i'm a fan of pagetables but i can't seem to find a usecase where this would be really useful? can you give an example? Link to comment Share on other sites More sharing options...
LostKobrakai Posted January 5, 2016 Share Posted January 5, 2016 Maybe not exactly a use-case for adding additional pages, but I'm using two separate pagetables to hold applications and fully accepted applications. The pages are just moved from one to another when a application is accepted and applications can only be added to the pagetable holding the non accepted ones. 3 Link to comment Share on other sites More sharing options...
ottogal Posted August 5, 2016 Share Posted August 5, 2016 On 4.1.2016 at 2:10 AM, Jonathan Lahijani said: The nice thing about a PageTable field is its presentation capabilities which a Page field doesn't have. ... So, to summarize the above, should Page fields be able to have an option to present themselves like how PageTables do? My question is the other way round: Could a PageTable have the option to limit itself to one row - like the choice of Simple Page for a Page field? (Or to limit it to a configurable number of rows.) Background: I would like to profit from the "presentation capabilities" of a Page Table field, but want to restrict it to a maximum of one Page (row). Chosen this option, there should be an Add new button only as long as the Page Table is empty. After adding 1 row, the button should disappear. (I would like to avoid the hook proposed by @Soma here - btw: I couldn't get it to work.) Link to comment Share on other sites More sharing options...
bernhard Posted August 5, 2016 Share Posted August 5, 2016 hi @ottogal that would be quite easy achievable via javascript. see this post of how i implemented this on a pagefield: 1 Link to comment Share on other sites More sharing options...
ottogal Posted August 5, 2016 Share Posted August 5, 2016 Thank you @bernhard, that was really fast... I'll dive into it and try to understand. 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