Hey Akbar – there’s not currently any XPHP functions that check the filesystem like you’re describing. It is something a custom module could do relatively easily, though—any variables that you save to the globals array like $GLOBALS['foobar'] early enough in a custom module (say, in onLoad, or I think onBeforeOutput would work too) will be exposed to the page as XPHP variables (<xphp var="foobar"/>.
<xphp content="true">
<if var="server_path" value="{group_directory}index.php"/>
<content>
<!– show this if it's the group homepage –>
</content>
</xphp>
Is that not something that could be used right in the template instead of going to the trouble of creating Custom module? I found that on your documentation site.
The server_path variable contains the path of the currently loaded page – XPHP Variables - LiveWhale Support – so it wouldn’t be able to check for the existence of another page like I think you’re envisioning.
<xphp if="server_path" matches="{group_directory}index.php"> translates to “If this is the group homepage”
or you could think of it as <xphp if="server_path" matches="/foo/bar/index.php">This is the /foo/bar/ page</xphp>