ProcessWire icon indicating copy to clipboard operation
ProcessWire copied to clipboard

PageTable page with page field and custom php code

Open somatonic opened this issue 10 years ago • 9 comments

I wanted to have a PageTable field store entry pages in a separate branch. The problem is:

Now when I create a new entry via a PageTable, I enter title and click save and it shows the page to edit (in the modal). So far so nice.

But the page isn't yet saved to the PageTable field and I can't use a page field using a custom php code to list pages that are relative to the page the PageTable is on. Only if closing and reopen the entry again it works, or if I choose to store the entry page under the page as children. But I don't want to do this cause they are in the way.

It's not a bug and I know why this is. My question is would it be possible to store the entry page to the PageTable field once it's created and being edited, so I can use custom php code in a page field?

somatonic avatar Sep 29 '14 16:09 somatonic

Maybe adding the "page_id", where the PageTable item is created from, to the url GET? Otherwise I can't make a page select dynamic and relative to the page it is created on, and one has to first save/publish it, then reopen the item to get the page select to work.

somatonic avatar Oct 13 '14 08:10 somatonic

Any ideas?

somatonic avatar Oct 28 '14 15:10 somatonic

Just an idea, I did not try this myself. Did you try using "Automatic Page Name" for the pagetable?

phlppschrr avatar Oct 28 '14 15:10 phlppschrr

Thanks, but this is a different issue not related to automatic page name or not. It's about PageTable field no yet saved, so the custom PHP code can't find search the field for the current editing page.

somatonic avatar Oct 28 '14 16:10 somatonic

Any idea on this one?

somatonic avatar Feb 03 '15 10:02 somatonic

Any news on this one? ...

somatonic avatar May 18 '15 11:05 somatonic

I'd like to check in on this also - i'm running into a snag trying to assign the ID of the page that 'owns' the pagetable page because they are assigned to a separate branch of the tree. I will need that value available as soon as the first save is done, but before the modal closes, so that i can assign inherited values to the page, from the 'owner page'... I see that the data-url attribute contains the id of the owning page, so would wonder how hard it would be to add a property (forPage, or ownerPage) to the new page, to help with this...

outflux3 avatar Jul 05 '17 16:07 outflux3

Just hit this particular problem too :) would be super useful to have the solution @outflux3 proposes.

elabx avatar May 13 '19 22:05 elabx

@elabx I'm not sure Ryan looks at issues on this repository now that the codebase has moved to the ProcessWire organisation. Please could you open a new issue on processwire-issues to ensure this doesn't get forgotten?

netcarver avatar May 14 '19 10:05 netcarver