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

Andy Grunwald [wmdb] andreas.grunwald at wmdb.de
Thu May 10 08:55:17 CEST 2012


If it only possible iN SQL if you join pages more than one like

SELECT * FROM pages p1 INNER JOIN pages p2 ON p1.pid = p2.uid AND 
p2.deleted = 0 INNER JOIN pages p3 ON pages.p2.pid = p3.uid ....

Am 08.05.2012 09:31, schrieb Pero Peric:
> 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




More information about the TYPO3-dev mailing list