GuidePremium
Media blocks in CoullWorks Blog for Laravel
The image, figure, gallery, video, embed and three banner blocks, plus the upload fields they share: every field with its limits, how it renders, the stored JSON, with screenshots.
Updated 16 November 2026Back to the package pageBuy
These blocks place pictures, video and third-party content in an article. Adding, moving and deleting blocks is in the block editor. The editor screenshots show the Edit block dialog opened from the gear on a block's line, and the rendered screenshots show the same block on the Blade front end of the demo blog.
The media upload fields#
Every image, video, poster or background in a block is an upload field, not a text box. (Older versions used a path text box; existing content is unchanged.)
| Part | Behaviour |
|---|---|
| Drop zone | Drag a file onto it, or press Browse. |
| Image fields | Helper text "Upload an image, or drop one here. Crop and rotate it with the editor." Pressing the pencil on the preview opens the image editor (crop, rotate). Largest file: 10 MB. |
| Video, poster and caption-track fields | The helper text is "Upload the file." These have no image editor. Largest file: 100 MB. (The Poster field is an image field and behaves like one.) |
| Remove | The cross at the top left of the preview clears the field. |
| Where files go | The directory cwb/blocks on the blog's image disk (coullworks-blog image disk setting). |
| Stored value | { "disk": "public", "path": "cwb/blocks/tent-hero.webp" }. The disk is stored with the path, so content whose file is on another disk keeps working. A path whose file has since been deleted keeps its stored value: the field shows the hint "File not found on the media disk. The stored path is kept until you clear this field or upload another file." and saving leaves the path as it was. Clearing the field or uploading a new file changes it. |
Tips. Upload WebP or JPEG sized for the layout, because the block shows the file as uploaded. Common mistake: replacing a file in storage by hand under the same name; the stored path is the only link, so re-upload through the field instead.
Image#

The Image block form. The preview shows the uploaded file gallery-3.webp.

The image on the page, the width of the text column.
What it is for. One bare image. When you need a caption, a credit, a wider layout or a second image for phones, use a Figure.
Add it. Picker group media, entry Image.
| Field (label) | Type | Required | Default | Allowed values and validation | What it does |
|---|---|---|---|---|---|
Media (media) | Image upload | Yes | Empty | An image file up to 10 MB | The picture. |
Alt (alt) | Text input | Yes, unless Decorative is on | Empty | Up to 300 characters. Shown only while Decorative is off | Alternative text for screen readers and for when the image does not load. |
Decorative (decorative) | Toggle | No | Off | On or off | For an image that adds nothing a reader needs. Turning it on hides the Alt field and stores an empty alt, so screen readers skip the image. |
Title (title) | Text input | No | Empty | Up to 300 characters | The title attribute (a tooltip). |
Stored: { "media": { "disk": "public", "path": "cwb/blocks/gallery-3.webp" }, "alt": "An orange tent on a green ridge under cloud", "decorative": false, "title": "On the ridge" }.
Tips. Describe what the picture shows, in a sentence, not "image of". The picture is lazy loaded and given its width and height, so the page does not jump.
Common mistakes. Marking a meaningful photo as decorative to skip the alt text, and leaving Alt empty with Decorative off (the save is refused).
Figure#

The Figure block form. Mobile Media is empty, so the same image is used on phones.

The figure on the page. The caption and the credit sit together under the picture.
What it is for. An image with a caption and a credit, optionally wider than the text and optionally a different crop on phones.
Add it. Picker group media, entry Figure.
| Field (label) | Type | Required | Default | Allowed values and validation | What it does |
|---|---|---|---|---|---|
Media (media) | Image upload | Yes | Empty | An image up to 10 MB | The picture. |
Mobile Media (mobile_media) | Image upload | No | Empty | An image up to 10 MB | A second image shown below 768 px wide. One alt text serves both images. |
Alt (alt) | Text input | Yes, unless Decorative is on | Empty | Up to 255 characters | Alternative text. |
Decorative (decorative) | Toggle | No | Off | On or off | Marks the image as decoration, with no alt. |
Caption (caption) | Rich text, bold, italic, strikethrough and link only | No | Empty | Inline text | The caption. |
Credit text (credit_text) | Text input | No | Empty | Up to 255 characters | The credit line, for example "Photo: Caylee Betts, CC0". |
Credit url (credit_url) | Text input | No | Empty | Up to 2048 characters; must start with http:// or https:// | Links the credit text. |
Alignment (alignment) | Select | Yes | text | text, wide, full | How wide the figure runs: the text column, wider than it, or the full width. In the article rail layout wide and full stay inside the column. |
Lightbox (lightbox) | Toggle | No | Off | On or off | Lets a reader open the image larger in a dialog. See the section below. |
Stored: { "media": {...}, "mobile_media": null, "alt": "...", "decorative": false, "caption": "<p>...</p>", "credit_text": "Photo: Caylee Betts, CC0", "credit_url": null, "alignment": "text", "lightbox": false }.
How the lightbox works. With Lightbox on, the picture is wrapped in a plain link to the full file, so without JavaScript a click simply opens the image. With the script, one native dialog shows the picture with its caption, a close button, and a click on the backdrop or the Escape key closes it; focus returns to the picture you opened. A decorative image, or one with no alt text, is never turned into a link. A click with Ctrl, Cmd or Shift, or in a browser without dialog support, behaves as an ordinary link.

The Figure lightbox open on a 1440 px window, over the dimmed article.

The same dialog on a 390 px wide window.
Tips. Give a credit URL for any image you did not make. Use a Mobile Media crop when the main image has detail at the edges that a narrow phone screen would cut.
Common mistakes. A credit URL without https://, and putting the credit inside the caption as well as in Credit text.
Gallery#

The Gallery block form with three images. Collapse all and Expand all sit above the list, and Add to images below it.

The gallery in the 3-up layout.
What it is for. A set of related images shown together.
Add it. Picker group media, entry Gallery. Press Add to images for each picture; drag the arrows to reorder; the bin removes one.
| Field (label) | Type | Required | Default | Allowed values and validation | What it does |
|---|---|---|---|---|---|
Images (images) | List | Yes | Empty | At least one image | The pictures. |
Media (images.media) | Image upload | Yes | Empty | An image up to 10 MB | The picture. |
Alt (images.alt) | Text input | Yes, unless Decorative is on | Empty | Up to 255 characters | Alternative text for that image. |
Decorative (images.decorative) | Toggle | No | Off | On or off | Marks that image as decoration. |
Caption (images.caption) | Text input | No | Empty | Up to 255 characters | A caption under that image. |
Layout (layout) | Select | Yes | 3-up | single, 2-up, 3-up, masonry | How the images are arranged: one per row, two or three per row (one per row on a narrow screen), or masonry. |
Lightbox (lightbox) | Toggle | No | Off | On or off | Lets a reader open an image larger in a dialog. Every image of the gallery that has alt text opens in the same dialog, with Previous and Next. |
Stored: { "images": [ { "media": {...}, "alt": "Two tents glowing under a full moon beside a lake", "decorative": false, "caption": "Dusk, calm" } ], "layout": "3-up", "lightbox": false }.
Gallery lightbox. With Lightbox on, the dialog shows the chosen image and its caption, and adds Previous image and Next image buttons. The left and right arrow keys do the same, and the sequence wraps from the last picture to the first. Escape, the close button or a click on the backdrop closes it and focus returns to the thumbnail.

The gallery lightbox, with the arrows that move between pictures.

After closing, the page is as it was and the thumbnail that was opened has the keyboard focus ring.
Tips. The gallery is a list of figures with no bullet markers. Keep captions short; the picture carries the message. Three to six images read best.
Common mistakes. Using a gallery of one image (use Image), and skipping alt text on images in the middle of the list; each image needs its own.
Video#

The Video block form for a YouTube video with a poster image.

The page before the reader agrees to load YouTube. Nothing is requested from YouTube until the button is pressed.
What it is for. A video, either a file you upload or a YouTube or Vimeo video.
Add it. Picker group media, entry Video. Choose the Provider first, then fill the fields that provider needs.
| Field (label) | Type | Required | Default | Allowed values and validation | What it does |
|---|---|---|---|---|---|
Provider (provider) | Select | Yes | None | upload, youtube, vimeo | Where the video comes from. |
Url (url) | Text input | Yes for youtube and vimeo | Empty | Up to 2048 characters; must be a canonical https address of that provider. Error: "The URL must be a canonical youtube address." (or vimeo) | The address of the video. |
Media (media) | Video upload | Yes for upload | Empty | A file up to 100 MB | The video file. |
Poster (poster) | Image upload | Yes for upload, unless No poster is on | Empty | An image up to 10 MB | The still image shown before play. For YouTube and Vimeo it is the backdrop of the consent message. |
No poster (no_poster) | Toggle | No | Off | On or off | Means you are not giving a poster. |
Title (title) | Text input | Yes | Empty | Up to 255 characters | Names the video for assistive technology. |
Caption (caption) | Text input | No | Empty | Up to 255 characters | Shown under the video. |
Captions Track (captions_track) | File upload | No | Empty | A captions file up to 100 MB | Subtitles for an uploaded video. |
Aspect (aspect) | Select | Yes | 16:9 | 16:9, 4:3, 1:1, 21:9, 9:16 | The shape of the video frame. |
Accepted addresses: for YouTube, youtube.com/watch?v=ID, youtu.be/ID, youtube.com/embed/ID and youtube.com/shorts/ID (also m.youtube.com and youtube-nocookie.com), with an 11-character ID. For Vimeo, vimeo.com/ID and player.vimeo.com/video/ID, with a numeric ID. Only the provider's own host is accepted, so a look-alike address fails.
Stored: { "provider": "youtube", "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", "media": null, "poster": {...}, "no_poster": false, "title": "Pitching a dome tent in 90 seconds", "caption": "...", "captions_track": null, "aspect": "16:9" }.
How it renders. An uploaded video is a normal video player with controls, loaded only when played (preload="none"), with the poster. YouTube and Vimeo are consent gated: the page shows the poster, the message "This content is hosted by YouTube. Loading it shares data with them." and a Load YouTube content button. Only after the reader presses it, or has already agreed, is the provider's frame loaded. When the SEO setting seo.output.jsonld.video is on, the block also adds VideoObject structured data.
Tips. Always give a Title and, for uploads, a captions track. The editor shows all fields for every provider; fields that do not apply to the provider you chose are ignored.
Common mistakes. A shortened or tracking-parameter address that is not one of the forms above, and an upload with no poster and No poster off (refused).
Embed#

The Embed block form for a Spotify address.

The embed before consent. No request goes to Spotify until the reader presses the button.
What it is for. A post, pen, snippet, track or recording from another service.
Add it. Picker group media, entry Embed.
| Field (label) | Type | Required | Default | Allowed values and validation | What it does |
|---|---|---|---|---|---|
Url (url) | Text input | Yes | Empty | Up to 2048 characters; an https address on an allowed provider's host. Error: "Embeds are limited to: X, Bluesky, CodePen, GitHub Gist, Spotify, Loom." (it lists your allowed providers) | The page to embed. |
Title (title) | Text input | No | Empty | Up to 150 characters | The title of the frame, read by screen readers. When empty it is "Embedded {provider} content". |
Providers and hosts: X (x.com, twitter.com), Bluesky (bsky.app), CodePen (codepen.io), GitHub Gist (gist.github.com), Spotify (open.spotify.com), Loom (loom.com). Which of them are allowed is the list coullworks-blog.blocks.embed_providers, and each blog can override it with its blocks.embed_providers setting.
Stored: { "url": "https://open.spotify.com/track/abc123", "title": "A playlist for the pitch" }.
Tips. The embed is consent gated like the video block, so a reader who declines loses nothing but the embed. Consent is set up in the Blade front end. Always fill the Title.
Common mistakes. Using an address from a service not on the list (refused), an http address, or an address with a username in it.
Banner Bleed#

The Banner Bleed form, filled in. The Address field appears because Cta Link is set to Address.

The banner on a 1440 px wide window. It is wider than the text column (865 px here) but narrower than the window.
What it is for. A hero banner inside an article: a picture with a heading, a line of text and a button on top. The three banner blocks (Bleed, Constrained, Full) have identical fields; they differ only in width. Bleed runs wider than the text column, Constrained matches it, Full runs the whole window.
Add it. Picker group layout, entry Banner Bleed.
| Field (label) | Type | Required | Default | Allowed values and validation | What it does |
|---|---|---|---|---|---|
Image Desktop (image_desktop) | Image upload | No | Empty | An image up to 10 MB | The banner picture. |
Image Mobile (image_mobile) | Image upload | No | Empty | An image up to 10 MB | A different picture below 768 px wide. If only one image is set, it is used on every width. |
Alt (alt) | Text input | Yes when any image is set, unless Decorative is on | Empty | Up to 255 characters | Alternative text. |
Decorative (decorative) | Toggle | No | Off | On or off | Marks the banner image as decoration. |
Video Bg (video_bg) | Video upload | No | Empty | A file up to 100 MB | A background video drawn behind the overlay and the text. See the note below. |
Overlay color (overlay_color) | Text input | No | Empty | Up to 32 characters, a CSS colour such as #0b1a2b | The colour laid over the picture so text stays readable. |
Overlay opacity (overlay_opacity) | Number input | No | 0 | A whole number from 0 to 100 | How strong the overlay is. |
Heading (heading) | Text input | No | Empty | Up to 255 characters | The banner heading. |
Text (text) | Rich text, bold, italic, strikethrough and link only | No | Empty | Inline text | A line under the heading. |
Cta label (cta_label) | Text input | No | Empty | Up to 64 characters | The words on the button. |
Cta Link (cta_link) | Link picker | No | Empty | Address, Post, Category or Tag | Where the button goes. Choosing a kind shows its own field: Address (up to 2048 characters, starting https://, http://, mailto:, tel:, / or #), or a searchable Post, Category or Tag select. |
Min height (min_height) | Number input | No | Empty | A whole number from 0 to 4000 (pixels) | The least height of the banner. |
Alignment (alignment) | Select | Yes | left | left, center, right | Which way the text is aligned. |
The button appears only when both Cta label and Cta Link are set. The background video applies to all three banners.
Stored: { "image_desktop": {...}, "image_mobile": {...}, "alt": "A tent above the clouds", "decorative": false, "video_bg": null, "overlay_color": "#0b1a2b", "overlay_opacity": 35, "heading": "Three seasons, one tent", "text": "<p>The one we would <em>buy again</em>.</p>", "cta_label": "Read the review", "cta_link": { "kind": "url", "url": "https://example.com/tent-review" }, "min_height": 320, "alignment": "center" }.
Background video. When Video Bg is set, the banner draws a muted, looping video behind the overlay and the text, with no controls. The banner image is its poster, shown until the video plays. The video is decoration and is hidden from assistive technology, so the heading and text must carry the message. Visitors who prefer reduced motion get the still poster and the video never plays. Without JavaScript the poster shows. No sound is ever played.

A banner with a background video, on a 1440 px window. A still capture cannot show the motion.

The same banner at 390 px.
Tips. Use one banner near the top of a post, not several. Give the overlay enough opacity that the heading passes contrast against the photo. Set Min height when the picture is short.
Common mistakes. A banner with an image and no alt text (refused), a button label with no link (no button is drawn), and an overlay colour that is not a CSS colour.
Banner Constrained#

The Banner Constrained form. Every field is the same as Banner Bleed; see the table above.

The banner kept to the text column (673 px here).
What it is for. The same banner, held to the width of the article text. Use it when the banner should line up with the paragraphs around it.
Add it. Picker group layout, entry Banner Constrained.
Fields: the same thirteen as Banner Bleed, with the same labels, types, required rules, defaults and limits: image_desktop, image_mobile, alt, decorative, video_bg, overlay_color, overlay_opacity, heading, text, cta_label, cta_link, min_height, alignment. The notes on the background video and on the button apply too. The stored JSON has the same shape.
Common mistakes. The same as Banner Bleed. Choose Constrained over Bleed only for the width.
Banner Full#

The Banner Full form. Every field is the same as Banner Bleed; see the table above.

The banner across the whole window (1441 px here).
What it is for. The same banner, from one edge of the browser window to the other. It is the one that looks like a page hero.
Add it. Picker group layout, entry Banner Full.
Fields: the same thirteen as Banner Bleed. The stored JSON has the same shape.
Common mistakes. Using it in the middle of a long article, where a full-width band breaks the reading line; and a small image stretched to the window width, which looks soft. Upload an image at least as wide as the largest screen you care about.







