Is given segment/page name a root segment?
A root segment is one that is owned by the homepage or a direct parent of the homepage, i.e. /about/ might be a root page segment and /de/ might be a root language segment. If it is a root page segment like /about/ then this will return the ID of that page. If it is a root language segment like /de/ then it will return the homepage ID (1).
Available since version 3.0.186.
Usage
$int = $pagePaths->isRootSegment(string $segment);
Arguments
Name | Type(s) | Description |
---|---|---|
segment | string | Page name string or path containing it |
Return value
int
Returns page ID or 0 for no match.
PagePaths methods and properties
API reference based on ProcessWire core version 3.0.236