Lesson 4.4: Theme designers, practical task
The learner builds a small theme extension from an empty folder and switches it on for the public siteaccess only. The result must keep the administration untouched, carry no inline styles or scripts, and be traceable with template path comments.
Note
This is the trainer's own assessment, not an official certification. Each learner works on their own training installation; settings are changed for one siteaccess, never globally.
At a glance
| Course | Assessments and practical exercises |
| Module | Module 4: Assessing the technical courses |
| Duration | 100 minutes (5 briefing, 75 task, 20 scoring) |
| Level | Intermediate |
| Audience | Learners at the end of the Theme design course |
| Prerequisites | Lesson 4.3; a shell and an editor on the learner's own training installation |
Learning objectives
Learners who pass this task have shown that they can:
- create a theme extension with the required files;
- register its design and choose it for one siteaccess;
- load a stylesheet from the design without inline CSS;
- override one template for one content type;
- prove which file answered with template path comments, and switch them off again.
Trainer's notes
How to run it
- Before: one training installation per learner, served on a local port, with a site package that has articles. Learners know the name of the public siteaccess.
- Briefing: hand out the steps and the rubric; 75 minutes. The theme is called
<account>theme, its design<account>. - Scoring: open the public site and the administration, view the page source, read the files, and run the grep from step 9 yourself.
Common questions
May learners start from the design wizard? If your course taught it, yes; the files must still be complete and the rubric applies to the result (Design extension wizard).
Which stylesheet setting does the pagelayout read? That depends on the pagelayout the learner writes. Accept any
documented way to load a file from the design's stylesheets/ folder without a style block.
Pitfalls
SiteDesignset globally. The administration turns into the theme. Scored under Scope; recover with Resetting the lab.- Path comments left on. Scored; they must be off at the end.
Hands-on exercise
The task, as handed to learners. Work in the installation root of your own training installation.
Create
extension/<account>theme/withezinfo.php,extension.xml(version0.1.0in both),LICENSEand a shortREADME.mdthat documents theSiteDesignline an installer must set.Create
design/<account>/templates/pagelayout.tplin the extension: a simple page with a header showing the site name, the module result, and a footer with your theme's name.Create
design/<account>/stylesheets/theme.csswith at least a header and footer style, and load it from the pagelayout through the design (no<style>block, nostyle="").Add
settings/design.ini.append.phpwithDesignExtensions[]=<account>theme.Activate the extension, then set
SiteDesignfor the public siteaccess only:./console exp:ini set site.ini/DesignSettings/SiteDesign <account> siteaccess:<public siteaccess> --dry-run --allow-root-userRead the output, then run it without
--dry-run. Clear the INI and template caches.Override
node/view/full.tplfor the classarticlein your design (rule in the extension'ssettings/override.ini.append.php), showing the title and the intro with a class from your stylesheet. Clear the override and template caches.Check your templates with
php bin/php/eztemplatecheck.php -s<public siteaccess> extension/<account>theme/design/ --allow-root-user.Switch on template path comments for the public siteaccess, open an article, and copy the
STARTline that shows your override answeringnode/view/full.tpl. Switch the comments off again and clear the template cache.Run this from the installation root and keep the output (it should print nothing):
grep -rn -E "<style|style=\"|<script[^>]*>[^<]|on(click|change|load|submit)=" extension/<account>theme/designOpen the administration and check that it still uses its own design.
Expected result
- The public site shows the learner's header and footer, styled from
theme.css; articles use the override. - The administration looks as before.
- The template check reports the templates valid; the grep prints nothing.
- The learner's notes hold the
START ... (node/view/full.tpl)line; the comments are off at the end. - Setup > Extensions lists the theme with version 0.1.0.
Scoring rubric
| Criterion | 0: Not shown | 1: Partly | 2: Mostly | 3: Fully | Evidence |
|---|---|---|---|---|---|
| Theme extension files | Missing | Design only, no metadata | Metadata present, LICENSE or README missing | All files, versions agree, README documents SiteDesign | The files, Setup > Extensions |
| Registration and scope (must) | Theme not found | Found, but SiteDesign set globally | Public only, caches not cleared | Registered, public siteaccess only, admin unchanged | Both sites, the settings files |
| Pagelayout and stylesheet | Default look | Pagelayout, no stylesheet | Stylesheet loaded via inline block | Stylesheet loaded from the design, page styled | Page source |
| Override | None | Rule or file missing | Applies to all classes | Articles only, title and intro shown | An article and a folder |
| No inline code | Inline styles and scripts | Several found | One found | The grep prints nothing | The grep output |
| Tracing and clean-up | Not done | Comments on, not used | Line copied, comments left on | Line copied, comments off, template check clean | Notes, page source |
Pass: 12 of 18 points or more and Registration and scope at 2 or 3.
Quiz
Debrief questions to ask after scoring.
- Why does the README document
SiteDesigninstead of the theme setting it? - What would
DesignExtensions[]=<account>(the design name) have done? - What does the line
START ... (node/view/full.tpl)tell you? - Why does it matter that the grep printed nothing?
Answers
- A global
SiteDesignwould change the administration and every other site (The design settings a theme ships). - Nothing found: the value is the extension name (Registering the design).
- Your file answered the request for
node/view/full.tpl(Templates and design). - A site can switch on a Content Security Policy without the theme breaking (Removing inline scripts and styles).
Further reading
- The folder structure of a theme extension
- The design settings a theme ships
- Checklist: theme extension ready
Related pages
- Lesson 4.3: Theme designers, written test
- Module 4: Assessing the technical courses
- Assessments and practical exercises: 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.