{"id":98005,"date":"2026-10-04T12:38:00","date_gmt":"2026-10-04T16:38:00","guid":{"rendered":"https:\/\/overcentral.com\/en\/?p=98005"},"modified":"2026-09-29T07:52:14","modified_gmt":"2026-09-29T11:52:14","slug":"emdash-widgets-sections-layout-playbook-98005","status":"publish","type":"post","link":"https:\/\/overcentral.com\/en\/emdash-widgets-sections-layout-playbook-98005\/","title":{"rendered":"EmDash Widgets and Sections: The Non-Obvious Layout Playbook"},"content":{"rendered":"<p>You\u2019ve added a widget to a sidebar. You\u2019ve created a section and embedded it in a page. Easy, right? That\u2019s what every tutorial shows. But the real layout power in <a href=\"https:\/\/emdash.dev\" target=\"_blank\" rel=\"noopener noreferrer\" data-iacss-external=\"1\">EmDash<\/a> lives in the <em>gap<\/em> between these two systems\u2014and most developers miss it.<\/p>\n<p>EmDash widgets and sections serve distinct layout purposes. Widgets live in predefined areas (sidebars, footers) and are managed via the admin interface. Sections are reusable, component-like blocks that embed in any content type and can pull dynamic data. <a href=\"https:\/\/overcentral.com\/en\/star-wars-zero-company-ctd-fix-78585\/\" title=\"STAR WARS Zero Company CTD Mid-Mission: The Non-Obvious\" data-iacss-internal=\"1\">The non-obvious<\/a> insight: sections are the path to structured content, while widgets are best for simple, static UI elements that don\u2019t need version control.<\/p>\n<h2>Widgets: Familiar, but Not What You Think<\/h2>\n<p>EmDash ships with a widget system that looks a lot like WordPress circa 2005. You define widget areas (sidebars, footer columns), then drag-and-drop widgets into them. The source material calls this \u201cthe basis of WordPress like it was 25 years ago.\u201d<\/p>\n<p>But here\u2019s what the docs won\u2019t say: <strong>widgets in EmDash are not sandboxed by default.<\/strong> If you run EmDash on the free Cloudflare tier or self-host, widgets execute in-process\u2014same as plugins without dynamic workers. That means a poorly-coded widget can still read your database or modify files. The sandboxed plugin architecture only kicks in <a href=\"https:\/\/overcentral.com\/en\/eu-cra-reporting-requirements-80362\/\" title=\"EU CRA Demands What Shipped and When You Knew\" data-iacss-internal=\"1\">when you<\/a> pay for Cloudflare Workers ($5\/month) and explicitly use dynamic workers.<\/p>\n<p>So when should you use widgets? For static, non-interactive UI elements: a copyright notice, a logo, a list of social links. Things that don\u2019t touch the database and don\u2019t need to be version-controlled. For anything interactive\u2014a contact form, a login panel, a live search\u2014<strong>use a sandboxed plugin instead<\/strong>, even if it seems like overkill.<\/p>\n<h2>Sections: The Real Layout Engine<\/h2>\n<p>Sections are where EmDash breaks from WordPress\u2019s widget legacy. Think of them as reusable Astro components that you can create in two ways:<\/p>\n<ul>\n<li><strong>Via the admin<\/strong> \u2013 Create a section in the dashboard, give it content, and insert it into any post or page using the block editor. This is the \u201ctheme builder\u201d approach the source material praises.<\/li>\n<li><strong>Via code<\/strong> \u2013 Define a section as an Astro component in your project\u2019s file system. This gives you full version control, TypeScript typing, and the ability to inject dynamic data (e.g., \u201clatest 3 posts\u201d) without a plugin.<\/li>\n<\/ul>\n<p>The source material shows that EmDash ships with a \u201csections\u201d admin panel right next to widgets, calling them \u201clike the theme builders.\u201d That\u2019s accurate\u2014but the real power is in the code-defined sections. You can create a section that queries your D1 database for recent posts, then embed that section in multiple pages. The section\u2019s output updates automatically when content changes.<\/p>\n<p><strong>The non-obvious tradeoff:<\/strong> Admin-defined sections are easy to use but locked inside the database. Code-defined sections are harder to set up (you need to know Astro) but portable across deployments and environments. If you\u2019re building client sites, start with admin sections for content editors, then gradually migrate to code sections as you need dynamic behavior.<\/p>\n<h2>Widgets vs Sections vs Plugins: A Decision Framework<\/h2>\n<table class=\"mw-table\">\n<thead>\n<tr>\n<th>Dimension<\/th>\n<th>Widgets<\/th>\n<th>Sections<\/th>\n<th>Sandboxed Plugins<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Security isolation<\/td>\n<td>None (in-process)<\/td>\n<td>None (in-process)<\/td>\n<td>Full V8 isolate<\/td>\n<\/tr>\n<tr>\n<td>Admin management<\/td>\n<td>Drag-and-drop areas<\/td>\n<td>Block editor insertion<\/td>\n<td>Plugin install + manifest<\/td>\n<\/tr>\n<tr>\n<td>Dynamic data capability<\/td>\n<td>No (static HTML\/JS)<\/td>\n<td>Yes (via Astro components)<\/td>\n<td>Yes (via hooks + workers)<\/td>\n<\/tr>\n<tr>\n<td>Version control<\/td>\n<td>No (database-bound)<\/td>\n<td>Yes (if code-defined)<\/td>\n<td>Yes (plugin code + manifest)<\/td>\n<\/tr>\n<tr>\n<td>Best for<\/td>\n<td>Simple, static UI elements<\/td>\n<td>Repeated layout blocks<\/td>\n<td>Interactive features (forms, search)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>The Practical Workflow<\/h2>\n<ol>\n<li><strong>Identify what\u2019s static.<\/strong> Copyright text, logo, site-wide banner \u2192 widget.<\/li>\n<li><strong>Identify what\u2019s repeated.<\/strong> Header, footer, call-to-action block, \u201cabout the author\u201d \u2192 section. Define it in code if it needs to change across environments.<\/li>\n<li><strong>Identify what\u2019s interactive.<\/strong> Contact form, comment system, analytics dashboard \u2192 sandboxed plugin. Accept the $5\/month cost for the security guarantee.<\/li>\n<li><strong>Combine them.<\/strong> A widget can render a section via a shortcode or Astro component. This lets you keep the widget area as the \u201cplacement layer\u201d while the section handles the actual rendering.<\/li>\n<\/ol>\n<h2>The Pitfall Most Beginners Ignore<\/h2>\n<p>The source material says EmDash is \u201cmoving completely away from widgets.\u201d That\u2019s the direction\u2014but right now, widgets are still the easiest way to put content in a sidebar. The mistake is using widgets for anything that appears on multiple pages (like a newsletter signup). That should be a section, because sections support dynamic content and version control. A widget\u2019s content is stored in the database as plain text; a section\u2019s content can be fetched from your content types, keeping it DRY.<\/p>\n<p>When you inevitably need to change that signup form across 50 pages, you\u2019ll thank yourself for using a section instead of 50 widget instances.<\/p>\n<h2>Looking Ahead<\/h2>\n<p>EmDash\u2019s layout system is still in flux. The team has signaled that widgets will eventually be deprecated in favor of sections and Astro components. For now, treat widgets as a legacy compatibility layer and sections as the primary tool. The developers who adopt this mindset early will have an easier migration path when the inevitable shift happens.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You\u2019ve added a widget to a sidebar. You\u2019ve created a section and embedded it in a page. Easy, right? That\u2019s what every tutorial shows. But the real layout power in EmDash lives in the gap between these two systems\u2014and most developers miss it. EmDash widgets and sections serve distinct layout purposes. Widgets live in predefined [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":99139,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/cards.overcentral.com\/cards\/en\/98005.png","fifu_image_alt":"EmDash Widgets and Sections: The Non-Obvious Layout Playbook","footnotes":""},"categories":[31],"tags":[],"class_list":["post-98005","post","type-post","status-publish","format-standard","has-post-thumbnail","category-technology"],"fifu_image_url":"https:\/\/cards.overcentral.com\/cards\/en\/98005.png","fifu_image_alt":"EmDash Widgets and Sections: The Non-Obvious Layout Playbook","_links":{"self":[{"href":"https:\/\/overcentral.com\/en\/wp-json\/wp\/v2\/posts\/98005","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/overcentral.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/overcentral.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/overcentral.com\/en\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/overcentral.com\/en\/wp-json\/wp\/v2\/comments?post=98005"}],"version-history":[{"count":1,"href":"https:\/\/overcentral.com\/en\/wp-json\/wp\/v2\/posts\/98005\/revisions"}],"predecessor-version":[{"id":99140,"href":"https:\/\/overcentral.com\/en\/wp-json\/wp\/v2\/posts\/98005\/revisions\/99140"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/overcentral.com\/en\/wp-json\/wp\/v2\/media\/99139"}],"wp:attachment":[{"href":"https:\/\/overcentral.com\/en\/wp-json\/wp\/v2\/media?parent=98005"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/overcentral.com\/en\/wp-json\/wp\/v2\/categories?post=98005"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/overcentral.com\/en\/wp-json\/wp\/v2\/tags?post=98005"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}