[TYPO3-dev] Which page ID belongs to which site

Jigal van Hemert jigal.van.hemert at typo3.org
Mon May 7 20:23:48 CEST 2012


Hi Pero Peric,

On 7-5-2012 20:04, Philipp Gampe wrote:
> Pero Peric wrote:
>
>> I'm doing some mysql queries on TYPO3 DB and I need to know which page ID
>> belongs to which site/domain. I can't find relation in DB, so anybody
>> knows? Thx.
>
> The domains are stored in sys_domain. The page is saved in the column pid.
> But for what you want to find out (which domain a page has), you will have
> to walk up the rootline, until you find a page with a domain record.
>
> I advise you to use a PHP file and then to use the TYPO3 API to get the
> information you need.

The API functions are:

- t3lib_BEfunc::BEgetRootLine($uid, $clause = '', $workspaceOL = FALSE)
   to get the array with the pages in the rootline (the list of pages 
from the 'current' page back to the root of the page tree)
- t3lib_BEfunc::firstDomainRecord($rootLine)
   to get the first domain record in the rootline

HTH
-- 
Jigal van Hemert
TYPO3 Core Team member

TYPO3 .... inspiring people to share!
Get involved: typo3.org



More information about the TYPO3-dev mailing list