Add-on Documentation from JCOGS Design

Advanced TopicsLast updated: 4 February 2026

This section covers behaviour details and constraints.

Art Direction

What “art direction” means

In this add-on, art direction means selecting different images for different viewport conditions (most commonly, different viewport widths).

This is different from:

  • Responsive images via srcset/sizes on a single <img> tag (same image content, different resolutions)
  • Using <picture> only for file format fallbacks (for example AVIF/WebP/JPEG).

JCOGS Image Pro already provides support for these two use cases via automatic browser capability checks and its built-in support for responsive image definition.

Art direction is about creative/layout-driven swaps (for example “wide landscape on desktop” vs “tight portrait crop on mobile”), which requires different source images, not just different sizes.

Real-world example

Imagine a hero banner where:

  • On desktop, you want a wide landscape photo that shows the full scene.
  • On mobile, you want a tighter portrait crop that keeps the subject large and readable.

With art direction enabled, a content editor can:

  1. Select a strong “default” (main) image.
  2. Add a mobile breakpoint row (for example media="(max-width: 600px)") and choose a different alternate image that is framed specifically for small screens.

If the user’s device matches the mobile media query, the alternate image is served. Otherwise, the browser falls back to the main image.

Behaviour

When art direction is enabled in field settings:

  • The main image is always the default/fallback.
  • Each art-direction image row has an explicit Main image or Alternate image source choice.
  • A Main image row uses the main image and its adjustments at that media condition, without requiring another file selection.
  • An Alternate image row can select a different image.
  • If alternate images are selected, when a JCOGS Image Pro Field tag is encountered - e.g. {field:img}it will render as a <picture> element with <source> tags and a fallback <img>.

In other words:

  • If no alternate image source is specified{field:img} behaves as a normal image output.
  • If the developer has configured the Art Direction control with pre-defined main-image rows, even if alternate images are not chosen by the content editor, a picture tag will be rendered.
  • Main-image sources mirror the fallback’s responsive candidates and sizes; they do not have a separate preset.

Use the move and delete icons beside each settings row to reorder or remove breakpoints.

Presets per alternate image

Depending on how the developer configured the field, each alternate row may:

  • Inherit the main/default preset
  • Use an explicit preset chosen for that breakpoint
  • Use no preset for that breakpoint

This allows you to keep a consistent “house style” while still having the freedom to pick different source images per breakpoint.

Template access

The simplest way to use art direction is to rely on {field:img}: the field can output <img> or <picture> automatically.

If you need more control, you can iterate breakpoint rows via the art-direction pair:

{field pair="art_direction"}
    {if file_id}
        <source media="{media}" srcset="{url}">
    {/if}
{/field}

Alternate crops

The developer can enable Allow crop for each alternate row and optionally specify a ratio such as 16:9. A blank ratio allows a free crop. These controls do not depend on whether main-image cropping is enabled.

In the Art Direction tab, select an alternate and choose Adjust crop. Drag or resize the rectangle; the preview shows that alternate with its applicable preset and crop. Apply crop saves the adjustment, Clear crop removes it, and Back discards changes made in this crop editor. Replacing an alternate clears its old crop without changing other rows or the main image.

The rectangle has the same control buttons as the main crop tool:

  • The green Save crop button applies the alternate crop and closes its editor.
  • Restore saved crop returns to the rectangle shown when this editor opened and refreshes the preview, without saving. If there was no saved crop, it returns to the initial default rectangle.
  • The red Clear crop button removes this alternate's crop and closes its editor.

The existing Apply crop, Clear crop and Back buttons remain available. None of these alternate controls changes the main image or another breakpoint.

Alternate crops neither inherit nor satisfy mandatory main-image cropping. Focal-point adjustments remain main-image only. New Fluid and Bloqs occurrences must be saved before opening adjustments; new Grid rows stage their adjustments until the entry save assigns a native row ID.

Changing crop settings

  • Changing a ratio offers Keep existing crops (the default) or Clear existing crops. Kept crops retain their rectangles; the new ratio applies when the editor next adjusts one. Removing a ratio is also a ratio change. The choice appears only when changing the ratio of an existing crop-enabled row, and has no effect if that breakpoint has no saved crops.
  • Disabling crop permission clears that row’s crops, not its selected images.
  • Removing a row or changing it from Alternate to Main removes that row’s alternate selections and crops. Changing only its media query preserves them.
  • Cleanup is deferred until a relevant live publish field opens. It processes attributable saved occurrences; ambiguous legacy associations are preserved and reported rather than guessed. Repeated cleanup attempts do not clear a newly edited crop again.

Revisions

Alternate selections and crops are current editorial state, not revisioned state. Viewing or restoring a revision does not resurrect historical or cleared alternates. Current art direction is shown only for an occurrence that still exists and can be identified exactly; alternate controls are read-only in a revision view.

New main-image adjustment snapshots are stored inside EE's own revisions. Changes made to an identifiable revision's main adjustments are saved only when the entry is saved, not when its modal closes.

Grid can conceal historical row identity and Bloqs can recreate blocks on restore. These occurrences use an explicit save-first restriction. Historical main adjustments are not reconstructed by matching files or row positions. Full historical main-adjustment recovery for recreated composites is not part of this release. If an unresolved occurrence has a selected main image and requires cropping, a fixed aspect ratio or alternate images, its revision restore is explicitly blocked with an explanation. Mandatory requirements are not bypassed. Return to the current entry to edit its images instead. Ordinary saves and identifiable revision contexts retain their usual rules.