06.08.2026 | Lothar Ferreira Neumann

Change custom text field sizes in Gin Backend Theme using Asset Injector

To alter the node ID field (nid) of our content view we add this to the file:

asset_injector.css.gin.yml
/* Views exposed filter: appropriate field widths */
.views-exposed-form #edit-nid {
  max-width: 10ch;
}

Issue:

A custom text input field might appear too large in Gin. Our example uses an ID field which will usually never be filled with more than ~7 characters.

Prerequisites:

Our solution uses the Asset Injector module. This module can be useful for small additions to backend theming. However, there may be cleaner solutions to this, e.g. extending Gin for your project with some custom CSS, defining a custom field type, and more. 

Solution:

Adjust the width of specific Views exposed filter fields using CSS through Asset Injection. This keeps short numeric fields like Node ID compact and improves the layout of the exposed filter form. We are using the Gin backend theme in this example. You can access the asset injector for Gin here:
/admin/config/development/asset-injector/css/gin

Please note:

Don't use Asset Injector for altering a frontend theme.

 

 

Before:

Screenshot of the content view with long nid field.

After:

Content view with short nid field

Quick note how to get the right ID for the CSS file, in our case #edit-nid:

The ID of the field is shown in the inspector

Weitere DevBits

07.05.2026 | Dominik Wille

Exclude already-displayed entities from a view

Use the views_exclude_previous module. See below or open the module documentation for further information.

24.02.2026 | Lothar Ferreira Neumann

Hide a view if it yields no results

The Option in the view

Click here to enable the following option:

The checkbox to hide the view when its empty.