I am struggling with the following problem.
I have two database tables: Books and Category. I get all the data from the "books" -table through the Sysfolder in the Backend List-view for editing, sorting and managing it.
What I would like to receive is that this list will also indicate the name of the category in which the book is located.
In the "Books" table there is a field "external-key" "category_id"
, which determines which category the book belongs to. I tried using this "category_id"
to get the category name in the List-view from books.
When I define in TCA['books']
that category_id
like:
'category_id' => array ( 'exclude' => 0, 'label' => 'Cat name', 'config' => array ( 'type' => 'select', 'foreign_table' => 'category', 'foreign_table_where' => 'AND category.id=###REC_FIELD_category_id###', 'eval' => 'int', 'checkbox' => '0', 'default' => 0 ) ),
it connects books and categories using category_id
(in a table book) and uid
(in a category table).
Not as I would like to link them using category_id (in the Books-table) and id (in the Category table). This id is a category identifier and may differ from uid.
Am I doing something wrong or is Typo3 somehow automatically doing this "join" with foreign uid
tables.? Is there any way to get it as I would like?
source share