getmediawall / craft-media-wall
TV size, seating distance, mount height, recess, HDMI cable and slat-panel numbers for TV-mounting and media-wall pages in Craft CMS.
Package info
github.com/getmediawall/craft-media-wall
Type:craft-plugin
pkg:composer/getmediawall/craft-media-wall
Requires
- php: ^8.2
- craftcms/cms: ^5.0.0
Requires (Dev)
- phpunit/phpunit: ^11.0
- twig/twig: ^3.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
This plugin gives TV-mounting and media-wall numbers for Craft 5 templates: TV size, seating distance, mount height, recess (niche) size, HDMI cable runs, slat-panel counts and a materials checklist. It's built for TV installer, AV and home-builder sites that publish guides or quote pages in Craft.
The numbers are the same as in GetMediaWall's other tools: the Redmine Media Wall Estimator, the Trac macros and the phpBB BBCodes.
Requirements
- Craft CMS 5.0 or later
- PHP 8.2 or later
Installation
composer require getmediawall/craft-media-wall
php craft plugin/install media-wall
Or install it from the Plugin Store in the control panel. There are no settings and no database tables.
Usage
One-line texts:
{{ craft.mediawall.tvSize(65) }}
{# 65" TV: 56.7" x 31.9" screen #}
{{ craft.mediawall.viewingDistance(65) }}
{# 65" TV: sit 6.5-8.8 ft from the screen (40-30 degree field of view) #}
{{ craft.mediawall.mountHeight(75, 44) }}
{# 75" TV centred at 44": bottom edge 26" from the floor (eye height defaults to 42) #}
{{ craft.mediawall.slatPanels(120, 96) }}
{# 120" x 96" section: 5 panel(s) across x 1 row(s), 12 slats per panel, 0.90" gap, order 6 panels with one spare #}
A full estimate for one job:
{% set e = craft.mediawall.estimate({
tv_diagonal: 75, seat_distance: 110, eye_height: 42,
mount_type: 'tilt', wall_type: 'brick',
recessed: true, soundbar: true,
slat_wall: true, wall_width: 144, wall_height: 96
}) %}
Seat range: {{ (e.viewing.near / 12)|number_format(1) }}-{{ (e.viewing.far / 12)|number_format(1) }} ft
HDMI: {{ e.cables.hdmi_count }} x {{ e.cables.stock_length_ft }} ft
<ul>
{% for item in e.checklist %}
<li>{{ item[0] }}: {{ item[1] }}{% if item[2] %} ({{ item[2] }}){% endif %}</li>
{% endfor %}
</ul>
{% if e.warnings is not empty %}Check: {{ e.warnings|join(', ') }}{% endif %}
Inputs
| Key | Default | Notes |
|---|---|---|
tv_diagonal |
65 | inches |
tv_depth |
2.5 | inches |
eye_height |
42 | height of the TV centre |
seat_distance |
– | eyes to screen; adds a field-of-view verdict |
mount_type |
fixed |
fixed, tilt, full_motion |
wall_type |
wood_stud |
wood_stud, metal_stud, brick, concrete |
recessed, niche_margin |
false, 2 | adds the recess rough opening |
console_height, console_offset, hdmi_runs, soundbar |
18, 0, 2, false | used for the cable run and HDMI count |
slat_wall, wall_width, wall_height |
false, –, 96 | slat panels default to 24" x 96", with 1.1" slats and a 0.75" minimum gap |
How the numbers work:
- All lengths are in inches, and screens are 16:9.
- Seating distance uses a 40 degree (THX) to 30 degree (SMPTE) horizontal field of view.
- Bad values never throw. They're listed in
e.errors, and defaults are used in their place. - Checklist notes are generic. The mount and anchor maker's instructions and local code always come first.
Tests
composer install
vendor/bin/phpunit
tests/EstimatorTest.phpuses the same cases as the Redmine estimator.tests/TemplateTest.phprenders real Twig templates throughcraft.mediawall.
The plugin was also installed in a fresh Craft 5.12.1 site (PostgreSQL 16, PHP 8.5) with php craft plugin/install media-wall, and it rendered a front-end template with all the functions above.
About
Made by GetMediaWall, a US directory of TV installers and media wall builders. To draw a wall to scale with a TV, fireplace or console, try the free Design Your Wall planner.
Written with an AI assistant (Claude) and covered by PHPUnit tests. License: MIT.