Getting the pageId from "Site Code"

Hello,

I want to get the pageId in the “Site Code” so that I can use it in $w(pageId) to get certain properties and change/add objects in the page accordingly. I was unable to find a solution to do that in the “Site Code”. Is there anything like $w(this), $w(Page) or $w(_self)?

Also I was unable to pass a variable from the “Page Code” to the “Site Code” which might be a longer solution but would still work.

If anyone has a solution to share that would be great.

Thanks,
Bahadir

Hi Bahadir,

You can use $w(‘Page’). It has an id property if you need it.
Note that by default a page id is #page1, and you can change that from the properties panel on each individual page.
What are you trying to achieve?