Adding columns to your view
In our default list view that shows all our portfolio items in the backend, we currently only have a checkbox and the Title
column, so we need to add a few more columns in here. We will concentrate on the company
and id
columns initially, and then add status
and ordering
columns which are a bit more complex.
Adding simple columns
The first thing we need to do is adjust our model so that it selects the data from the database table jos_folio
that we want to display in this view. Edit the file /administrator/components/com_folio/models/folios.php
, and add the highlighted code:
<?php defined('_JEXEC') or die; class FolioModelFolios extends JModelList { public function __construct($config = array()) { if (empty($config['filter_fields'])) { $config['filter_fields'] = array( 'id', 'a.id', 'title', 'a.title', 'state', 'a.state', 'company', 'a.company' ); } parent::__construct($config); } protected...