J3.x

Developing a component frontend update function/Record list view page

From Joomla! Documentation

< J3.x:Developing a component frontend update function
Joomla! 
3.x
Tutorial
Developing a component frontend update function


18 Frontend item list view like in the backend

18.1 Description

Where the previous step of this tutorial 'cloned' the edit page from the back-end to the front-end, in this step also the list view page will be 'cloned' so that both component administration pages now run in the front-end with (almost) equal functionality, including toolbars, searching and ordering etc.

18.2 The changes

18.2.1 Files:

  • README.md
  • helloworld.xml
  • admin/sql/updates/mysql/*

Again, these files have been updated to reflect version info only.

18.2.2 site/views/helloworlds/view.html.php

Also for the list view the differences are limited.

  • Like in the previous step the display() function starts and ends by a call to respectively includeAdminEnv() and setDocument() that have been adapted to make required back-end functions available to the front-end as well.
  • The back-end list overview page featured a sidebar to switch between item management and category management. For this tutorial it is assumed to be of little relevance to the front-end, so has been left out.
  • For similar reason the preferences/options button in the right upper corner of the toolbar of the back-end pages has been left out as well.

18.2.3 site/views/helloworlds/tmpl/default.php

The layout template is adapted for the lacking side bar. Because of that the <div ... span10> is also superfluous.

18.2.4 site/views/helloworld/view.html.php

The changes in the edit view page in this step are even smaller than in the previous step as we can now remove the changes of the previous step for working around the lack of the list view page, that is now reintroduced again.

18.2.5 site/views/helloworld/tmpl/edit.php, site/views/helloworld/tmpl/edit.xml

These template layout files are equal to the versions of the previous step.

18.2.6 site/models/helloworld.php and .../helloworlds.php

The front-end model files for the list view and the edit page are equal to the back-end ones, except for a reference to a javascript file that is now in a front-end directory.

18.2.7 site/models/forms/*, site/models/rules/*, site/models/forms/helloworld.xml

The front-end files in these model directories are also equal to the back-end versions, with the exception of site/models/forms/helloworld.xml . As noted already in the previous step of the tutorial, the back-end edit page contains three section, the latter two for global configuration settings and permission settings. As these presumably are less relevant to the front-end edit page, they are left out.

18.2.8 site/table/*

Table access is the same in front-end and back-end, so the files in this directory are just a 'clone'.

18.2.9 site/controllers/helloworld.php and .../helloworlds.php

The front-end controller file helloworlds.php is equal to the back-end one. helloworld.php differs slightly as explained in the previous tutorial step, but the change is even less then previously as we do not have to work-around the missing list view page.

18.2.10 site/controller.php, site/helloworld.php

The base controller are equal to the previous step.

18.3 Source files for this step

18.4 Testing the features of this step

  • Prepare users and permissions, and test like previous step. And ...
  • Like in the previous step, check that also the front-end overview list looks like, and functions like the back-end counterpart.