Customizing backend show and list screens
I'm currently tryinng to develop my first extension, to manage recipes in a tl_recipes table, with ingredients details in a tl_recipes_lines child table. Each recipe will be assigned 1 to 3 categories, that will determine on which page(s) it will be displayed; categories are managed with the regular tl_page table, as I only need an id and a title.
[attachment=0:208oginv]Capture-75.png[/attachment:208oginv]
As for now, the recipes and their corresponding ingredients lines can be created/updated via the backend, and the tables content is OK. What remains to be done in the backend - and I have no idea how to do that - is:
1- in the show page, display a thumbnail instead of the recipe photo filename, and the categories names (= pages titles) instead of their ids.
[attachment=2:208oginv]Capture-73.png[/attachment:208oginv]
2- in the list page, populate the categories filter boxes, that remain empty, though the categories names appear in the list.
[attachment=1:208oginv]Capture-77.png[/attachment:208oginv]
Tnanks for helping.
Re: Customizing backend show and list screens
Anybody can help?
The Catalog extension allows to filter on foreign-key values, so there might be some way to achieve this.
Thanks for hints and ideas.
Re: Customizing backend show and list screens
I think the only way to achieve point 1 is to create own backend template. Take a look at ModuleMaintenance.php to see how it works.
Re: Customizing backend show and list screens
Thanks for the hint. I'll have a look.
Anybody has an idea about point 2, populating filter boxes with values from another table using foreign keys?
Re: Customizing backend show and list screens
if you use the Articles/Content as a template, you should be able to set-up your Recipe/Ingredients in exactly the same way...
you have to specify the filter as field in your dca, then you refer to that field. The field can then be set-up as member groups are (this allows you to create a field that does a lookup and then you can use the field in your filter:
Code:
'groups' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_content']['groups'],
'exclude' => true,
'inputType' => 'checkbox',
'foreignKey' => 'tl_member_group.name',
'eval' => array('mandatory'=>true, 'multiple'=>true)
),