-
caralog reference
Hi.
I'm using catalog reference to connect 2 tables (please look on cat_ref in attach),
but on page I only see a parent catalog table data.
When I'm look to SQL i'm get that
1 Query
Code:
SELECT id,pid,sorting,tstamp,a_title,a_image,magazine,a_text,ordering,featured,a_alias, (SELECT name FROM tl_catalog_types WHERE tl_catalog_types.id=cat_m_articles.pid) AS catalog_name, (SELECT jumpTo FROM tl_catalog_types WHERE tl_catalog_types.id=cat_m_articles.pid) AS parentJumpTo FROM cat_m_articles WHERE pid='2' AND magazine =1 ORDER BY ordering ASC LIMIT 0,5
It correctly select all related values (5 records), but then it call to the same SQL 5 times
Code:
1 Query SELECT aliasField FROM tl_catalog_types where id='2' LIMIT 0,1
1 Query SELECT * FROM tl_page WHERE id='27'
1 Query SHOW COLUMNS FROM `cat_m_articles`
1 Query SELECT * FROM cat_magazines WHERE id IN (1) ORDER BY sorting
1 Query SELECT tableName, aliasField, jumpTo FROM tl_catalog_types WHERE tableName='cat_magazines' LIMIT 0,1
1 Query SELECT * FROM cat_magazines WHERE id IN (1) ORDER BY sorting
1 Query SELECT * FROM cat_magazines WHERE id IN (1) ORDER BY sorting
1 Query SELECT * FROM cat_magazines WHERE id IN (1) ORDER BY sorting
1 Query SELECT * FROM cat_magazines WHERE id IN (1) ORDER BY sorting
Is there any way to get all parent and referenced to it child data?
Thank you for you help.
p.s. contao version: 2.9.1, catalog: 2.0.0 beta1
-
Re: caralog reference
All child data is already provided with the parent catalog query (list/reader), however, not all child LABELS and OPTIONS are looked up (so you will have to hard-code them) as they are not found in the database, but in the DCA, which is not loaded for each reference item, otherwise, this operation could go on recursively.
The easiest way around all of this, is NOT to display all that detail. Just display a link to the reference catalog reader page where you can display that detail somewhere else.