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

Pero Peric pperic at pero.hr
Tue May 8 09:31:15 CEST 2012


I thought this would be possible to do just with query, without scripting 
but it seems it's not. Anyway thank you for help!

Regards.

"Jigal van Hemert"  wrote in message 
news:mailman.1.1336415034.5720.typo3-dev at lists.typo3.org...

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