cID of homepage

Permalink
Hi,

Can I trust that the homepage will always be at: index.php?cID=0

(I'm working on an add-on that will be in the marketplace.)

celwell
 
shadowcomputers replied on at Permalink Reply
shadowcomputers
I think that the cID is 1 not 0 - not sure about always being there!
celwell replied on at Permalink Reply
celwell
cID=0 works on my c5 site. Do you have a site where only 1 works (and not 0)?
Mnkras replied on at Permalink Best Answer Reply
Mnkras
use 1 (or the constant HOME_CID, which = 1 by default)

when you pass the cid it checks if it is > than 0 if it is it will load the page, if it isn't it will load the homepage,
shadowcomputers replied on at Permalink Reply
shadowcomputers
I have tested deleting the home page, and although it was removed fromthe site map, when I went back to the site map it was there again.

So it looks like you cannot delete the home page, and the cID is always 1.

But Mnkras states, there is a constant variable you can use of HOME_CID, so I would use that incase something changes in future releases of Concrete5.
Mnkras replied on at Permalink Reply
Mnkras
You cannot delete the homepage,
the file tree is like shown:
Home
-About
-Page
--Page Subpage
-Other Page

Home is always at the top, if you deleted the homepage, then no pages would exist