Skip to content

ProcessWire.config.page should return correct id of edited page #1496

@jmartsch

Description

@jmartsch

Right now if you are editing a page in the admin the ProcessWire.config object reads

"page": {
 "id": 10,
 "name": "edit",
  "process": "ProcessPageEdit"
 }

regardless on which page you are really on.

But one might need the actual id of the page you are editing (for taking actions with JavaScript), which is in my case "processwire/page/edit/?id=564030".

I know that the page has a class that looks like this "ProcessPageEdit-id-564030" but it is cumbersome to get the id from this class.

I would suggest, that the ProcessWire.config.page object returns the ID and also name of the actual page you are editing:

"page": {
 "id": 564030,
 "name": "name-of-the-page",
  "process": "ProcessPageEdit"
 }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions