Skip to main content
GrN.dk

Main navigation

  • Articles
  • Cases
  • Contact
  • Your Digital Project Manager
  • About Greg Nowak
  • Services
  • Portfolio
  • Container
    • Excel Freelancer
    • Kubuntu - tips and tricks
    • Linux Apache MySQL and PHP
    • News
    • Image Gallery
User account menu
  • Log in

Breadcrumb

  1. Home

Moving Drupal Blocks on Mobile: CSS, Regions, and Safer Tradeoffs

By Greg Nowak. Last updated 2026-07-06.

A Drupal block that works well on desktop can become nearly invisible on a phone. A newsletter signup, contact CTA, filter panel, login box, or campaign message may be useful in a sidebar, but on mobile it can fall below the content that actually creates the inquiry, sale, or support outcome.

The practical question is not simply ā€œhow do we move this block?ā€ It is ā€œhow do we improve the mobile journey without creating a maintenance problem for editors and developers later?ā€ On current Drupal sites, the answer is usually simpler than older tutorials suggest. You do not need a breakpoint management module just to change layout. Drupal breakpoint files matter when Drupal itself needs breakpoint data, such as responsive image handling. If the change is only visual layout, start with theme CSS.

Choose the smallest reliable fix

Before adding regions or duplicate block placements, name the real business problem. Is the same content appearing too late? Does mobile need a shorter version? Do editors need control per landing page? Those are different implementation decisions.

Mobile requirement Best fit Watch out for
Same block, better reading order CSS flex or grid ordering Visual order should not confuse keyboard or screen reader users
Block belongs in a new structural spot Add a theme region and place a block there Region changes need template updates and cache rebuilds
Mobile needs different copy or a simpler CTA Separate mobile block placement Avoid duplicating complex forms or personalized output
Editors need page-by-page control Layout Builder or a content-managed layout pattern Define governance so every page does not drift
A practical decision matrix for moving Drupal blocks on smaller screens.

Option 1: Keep one block and reorder it with CSS

If the content is the same, keeping one block placement is usually the cleanest route. It preserves the existing block configuration, form behavior, caching, analytics hooks, and personalization logic. The theme simply changes where that rendered region appears at a mobile breakpoint.

For example, a desktop layout might show content beside a sidebar, while mobile should show the main content first and the sidebar CTA immediately after it:

@media (max-width: 767.98px) {
  .layout-shell {
    display: flex;
    flex-direction: column;
  }

  .region-content {
    order: 1;
  }

  .region-featured {
    order: 2;
  }

  .region-sidebar-first {
    order: 3;
  }
}

The exact selectors depend on the theme, but the rule of thumb is stable: reorder layout wrappers, not the business logic behind the block. If your theme already uses Bootstrap 5.3, responsive flex and order utilities can handle simple cases. If not, a small theme stylesheet is usually enough.

There is one important accessibility caveat. CSS ordering changes visual order, not the document or focus order. That is fine for modest presentation changes, but it can become confusing if a keyboard user, screen reader user, and sighted mouse user experience the same page in different logical sequences. Keep the source order sensible, then use CSS to make a good source order work better visually.

Option 2: Add a dedicated mobile region

Sometimes a visual reorder is not enough. A mobile CTA may need to appear directly below the header, while the desktop version still belongs in a sidebar. In that case, create a dedicated theme region and place a mobile-specific block into it.

Add the region to THEMENAME.info.yml:

regions:
  header: Header
  content: Content
  sidebar_first: Sidebar first
  mobile_after_header: Mobile after header
  footer: Footer

Then print that region in the relevant page template, usually page.html.twig or a page template variant:

{% if page.mobile_after_header %}
  {{ page.mobile_after_header }}
{% endif %}

Be careful here: once a theme declares regions, it is responsible for the regions it needs. Do not accidentally remove existing regions from the theme definition, and do not remove Drupal’s hidden page_top and page_bottom output from html.html.twig, because modules may depend on them.

After the theme change, rebuild caches with drush cr. Then go to admin/structure/block, select the active front-end theme, and place the block in the new region. Block placement is theme-specific, so checking the correct theme saves a lot of false debugging.

When duplicate block placements make sense

Drupal allows multiple copies of a block, each with its own configuration and visibility rules. That is useful for plain editorial or promotional blocks: one long desktop block in the sidebar, one shorter mobile block near the top of the page.

I would be more cautious with forms, exposed filters, cart widgets, login elements, or personalized components. Rendering two versions can create awkward validation, tracking, cache, or state issues. For those, one rendered block plus CSS reordering is usually safer.

If you do use separate desktop and mobile placements, use Drupal visibility rules for page logic, roles, and content sections. Use CSS for viewport display rules:

@media (max-width: 767.98px) {
  .block-desktop-only {
    display: none;
  }
}

@media (min-width: 768px) {
  .block-mobile-only {
    display: none;
  }
}

How I would ship this

  • Start with the mobile user journey, not the region list.
  • Use CSS reordering when the content is the same and only the sequence changes.
  • Add a mobile region when the block needs a genuinely different structural position.
  • Duplicate simple content blocks only when the editorial benefit is clear.
  • Document the breakpoint, region name, and reason for the decision in the handoff notes.

That keeps the implementation understandable for the next developer and practical for the people running the site. If this block move is part of a broader Drupal cleanup, redesign, or agency delivery plan, Greg can help turn the layout decision into a clean, testable implementation plan.

Related on GrN.dk

  • When URL Parameters Become an Operations Problem: Crawl Waste, Cache Fragmentation, and Duplicate URLs
  • AI Crawler Control for Business Websites: Protect Content Without Sacrificing Search Visibility
  • Drupal 8 Inline Responsive Images: Practical Setup for Legacy Sites

Need help with this kind of work?

Talk to Greg about your Drupal layout Get in touch with Greg.

Sources

  • Working with breakpoints in Drupal
  • Adding Regions to a Theme
  • Concept: Blocks
  • Placing a Block in a Region
  • Bootstrap 5.3 Flex Utilities
Last modified
2026-07-06

Tags

  • Drupal
  • Responsive design
  • Mobile UX
  • Theming
  • Bootstrap
  • Log in to post comments

Review Greg on Google

Greg Nowak Google Reviews

 

Illustrated infographic summarizing: One Timeout, Two Orders: Make AI Actions Safe to Retry
One Timeout, Two Orders: Make AI Actions Safe to Retry
2026-07-25

A timed-out AI action may already have succeeded. Stable keys, durable ledgers, queues and stored results prevent a routine retry from duplicating real work.

Illustrated infographic summarizing: Your AI Visibility Dashboard Needs a Methodology, Not More Charts
Your AI Visibility Dashboard Needs a Methodology, Not More Charts
2026-07-24

A practical framework for measuring AI-search visibility with fixed prompts, repeated tests, separate metrics, retained evidence, and honest reporting.

Illustrated infographic summarizing: AI Admin APIs Are Here—But Your Directory Is Still the Source of Truth
AI Admin APIs Are Here—But Your Directory Is Still the Source of Truth
2026-07-23

New AI admin APIs can automate access and spend controls, but reliable governance still starts with authoritative directory data and clear ownership.

Illustrated infographic summarizing: OpenAI Presence Arrived—But Is Your Workflow Ready for an Agent?
OpenAI Presence Arrived—But Is Your Workflow Ready for an Agent?
2026-07-22

Before an AI agent can take on real work, its workflow needs clear scope, permissions, handoffs, evaluation cases, and production monitoring.

Illustrated infographic summarizing: Chatbot Transcripts Quietly Became a Retention and Redaction Problem
Chatbot Transcripts Quietly Became a Retention and Redaction Problem
2026-07-21

Chatbot transcripts spread across providers, logs and support tools. Here is how to map each copy, redact sensitive data and test deletion properly.

Illustrated infographic summarizing: Cloudflare Service Keys Stop in September: Find Every Caller
Cloudflare Service Keys Stop in September: Find Every Caller
2026-07-20

Cloudflare Service Keys stop working on September 30, 2026. Here is how to find every caller, move to scoped API tokens and avoid a late outage.

Illustrated infographic summarizing: Your AI Workflow Needs an Acceptance Test Before It Meets Customers
Your AI Workflow Needs an Acceptance Test Before It Meets Customers
2026-07-19

A practical way to test AI workflows using realistic scenarios, tool checks, human rubrics, regression suites, and clear release gates.

Three cover candidates for The Goats Were Load-Bearing fanned on a dark background: an ember-lit door, three slow knocks, and a founders' ledger
The Goats Were Load-Bearing: a fantasy where the bill always comes due
2026-07-19

A teaser for the upcoming darkly comic fantasy novel The Goats Were Load-Bearing — a village, a door that must stay poor, and the worst possible time to sell the herd. Readers pick the cover.

Vegan Power game: the yellow player catches falling fruit while a chicken and a cow look on
Vegan Power: The Little Game About Eating Fruit, Not Friends
2026-07-19

Vegan Power is a free browser game where you catch fruit, dodge the animals, protect seven hearts, and chase a better high score.

KotobaMon title screen: the Japanese logo ć‚³ćƒˆćƒćƒ¢ćƒ³ over a low-poly 3D island with monsters, cherry-blossom trees and a trainer.
KotobaMon: Shipping a 3D Browser Game With No Build Step and Self-Hosted Voice
2026-07-19

A look at fantasy.grn.dk, a browser-based 3D game that teaches Japanese with no build step, procedural art and self-hosted AI voice, and what its constraints show about shipping interactive products fast and cheap.

More articles
RSS feed

GrN.dk web platforms, web optimization, data analysis, data handling and logistics.