Hack: display categories & added filter options in post overview
Posted: Tue Nov 19, 2019 7:03 am
In Bludit 3.10.0, I edited the content.php in bl-kernel\admin\views, because I think it´s a great plus in clarity when I can see the category of each post already in the post overview table. So I added a few lines to have an additional column that contains the category for each page which has the status "published".
The code I added is:
Where the heading of the output table is built, and further down in the loop
I added
Works fine for the present, but as it´s a kernel hack, a.) it will be gone with the next update and b.) it´s hard to make it useful for anybody else than me. Could anybody be so nice and give me a hint how the approach would be to wrap this into a plugin? And any other ideas for clever improvements or other thoughts and comments on my hack?
Or is there a possibility like a template override for the view I can use from within the admin theme (and build an alternative admin theme with my code)? Or some other way to do it not in the core code ...
Regards,
padawan
[EDIT]
In the meantime I even added jQuery tablesorter and made the whole post overview table sortable by a click on the column headings. It was so easy! Just 3 or 4 more lines of code. But still a core hack.
[/EDIT]
The code I added is:
Code: Select all
if ($type=='published') {
echo '<th class="border-0" scope="col">'.$L->g('Category').'</th>';
}
Code: Select all
foreach ($list as $pageKey)
I added
Code: Select all
if ($type=='published' && $page->category()) {
echo ' <td class="pt-3">'.$page->category().'</td>';
} else if ($type=='published' && ($page->category()==null)) {
echo ' <td class="pt-3">–</td>';
};
Or is there a possibility like a template override for the view I can use from within the admin theme (and build an alternative admin theme with my code)? Or some other way to do it not in the core code ...
Regards,
padawan
[EDIT]
In the meantime I even added jQuery tablesorter and made the whole post overview table sortable by a click on the column headings. It was so easy! Just 3 or 4 more lines of code. But still a core hack.
[/EDIT]