Module 5: Fetch functions
Templates get their data through fetch functions. This module goes from the first fetch( 'content', 'node', ... )
to a paged, filtered list on a real page, through the fetches of other kernel modules, and ends with learners
writing a fetch function in their own extension.
At a glance
| Course | Developers |
| Duration | 3 hours 30 minutes (with one 10-minute break) |
| Lessons | 4 |
| Level | Intermediate to advanced |
Lessons
| Lesson | Duration | What learners do |
|---|---|---|
| Lesson 5.1: Fetching nodes and lists | 45 minutes | node, list, list_count, reading function_definition.php |
| Lesson 5.2: Filters, sorting and paging | 55 minutes | Class and attribute filters, tree and depth, sort_by, the navigator |
| Lesson 5.3: Fetches of other modules | 40 minutes | current_user, has_access_to, sections, relations, site data |
| Lesson 5.4: A fetch function of your own | 60 minutes | A module, function_definition.php and a function collection class |
Preparing this module
- The training installation needs enough content for filters and paging to show something: a folder with at least six articles or notes, and a few folders below node 2.
mysite_hellois active on each installation (lesson 3.1) and the override of lesson 3.2 is in place for the paging exercise.- For lesson 5.3, each learner has a site account (not an administrator) to compare signed in and signed out.
- Rehearse lesson 5.4 once; keep a finished copy of the three files to hand out to learners who fall behind.
Timing plan
| Part | Minutes |
|---|---|
| Lesson 5.1 | 45 |
| Lesson 5.2 | 55 |
| Break | 10 |
| Lesson 5.3 | 40 |
| Lesson 5.4 | 60 |
| Total | 210 |
Related pages
- Developers: course overview
- Trainers: start here
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.