8.4.2 What's the site root (Home) page id?
Permalink
Could anyone please tell me what the site root (Home) page id is?
Or how do I find that out? That page doesn't have a name or url slug, so I can't use the getByName or getByPath
Or how do I find that out? That page doesn't have a name or url slug, so I can't use the getByName or getByPath
8 years after using C5 I learned today it actually shows that... ))) I never noticed
Thank you.
Would you know how to check for its ID programmatically? I have to check a page ID before I delete it to be sure I never delete the root page
Thank you.
Would you know how to check for its ID programmatically? I have to check a page ID before I delete it to be sure I never delete the root page
In 5.6 and 5.7 I would use this
Don't about Version 8 though..
<?php echo $c->getCollectionID() ?>
Don't about Version 8 though..
I have a vague feeling that multilingual requirements may have necessitated a change to this (in some cases). I think there was a github issue on it. I don't recall what the resolution was; perhaps bunging something in a config file.
There is a constant called HOME_CID, typically with a value of 1.
There is also Page::getHomePageID() which takes account of locale in a multi-site.
There is also Page::getHomePageID() which takes account of locale in a multi-site.
Thank you for that. I'll use Page::getHomePageID()
If you put the page into edit mode does it not display the cID in the browser address bar?