Skip to content
Available for new work
Pages in Blog

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.)

PartBehaviour
Drop zoneDrag a file onto it, or press Browse.
Image fieldsHelper 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 fieldsThe 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.)
RemoveThe cross at the top left of the preview clears the field.
Where files goThe 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: Media upload with a preview, Alt, Decorative and Title

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

A rendered Image block: a tent on a green ridge under cloud, full column width

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)TypeRequiredDefaultAllowed values and validationWhat it does
Media (media)Image uploadYesEmptyAn image file up to 10 MBThe picture.
Alt (alt)Text inputYes, unless Decorative is onEmptyUp to 300 characters. Shown only while Decorative is offAlternative text for screen readers and for when the image does not load.
Decorative (decorative)ToggleNoOffOn or offFor 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 inputNoEmptyUp to 300 charactersThe 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: Media, Mobile Media, Alt, Decorative, Caption, Credit text, Credit url, Alignment and Lightbox

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

A rendered Figure block: a canvas tent and a tipi, with a caption and a photo credit under the picture

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)TypeRequiredDefaultAllowed values and validationWhat it does
Media (media)Image uploadYesEmptyAn image up to 10 MBThe picture.
Mobile Media (mobile_media)Image uploadNoEmptyAn image up to 10 MBA second image shown below 768 px wide. One alt text serves both images.
Alt (alt)Text inputYes, unless Decorative is onEmptyUp to 255 charactersAlternative text.
Decorative (decorative)ToggleNoOffOn or offMarks the image as decoration, with no alt.
Caption (caption)Rich text, bold, italic, strikethrough and link onlyNoEmptyInline textThe caption.
Credit text (credit_text)Text inputNoEmptyUp to 255 charactersThe credit line, for example "Photo: Caylee Betts, CC0".
Credit url (credit_url)Text inputNoEmptyUp to 2048 characters; must start with http:// or https://Links the credit text.
Alignment (alignment)SelectYestexttext, wide, fullHow 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)ToggleNoOffOn or offLets 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 lightbox open over a Figure: the full tarn photograph in a white dialog with a close button at the top right and the caption "The tarn at first light, before the wind came up." below

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

The lightbox open on a phone-width window

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.

The Gallery block form: a list of three images, each with Media, Alt, Decorative and Caption, then Layout and Lightbox

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

A rendered Gallery block: three images side by side, each with a short caption under 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)TypeRequiredDefaultAllowed values and validationWhat it does
Images (images)ListYesEmptyAt least one imageThe pictures.
Media (images.media)Image uploadYesEmptyAn image up to 10 MBThe picture.
Alt (images.alt)Text inputYes, unless Decorative is onEmptyUp to 255 charactersAlternative text for that image.
Decorative (images.decorative)ToggleNoOffOn or offMarks that image as decoration.
Caption (images.caption)Text inputNoEmptyUp to 255 charactersA caption under that image.
Layout (layout)SelectYes3-upsingle, 2-up, 3-up, masonryHow the images are arranged: one per row, two or three per row (one per row on a narrow screen), or masonry.
Lightbox (lightbox)ToggleNoOffOn or offLets 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 open on the second picture: a tent on a green ridge, the caption "In the lee", previous and next arrows at the sides and a close button at the top right

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

The article after the lightbox was closed: the gallery of three pictures with the second thumbnail outlined

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: Provider, Url, Media, Poster, No poster, Title, Caption, Captions Track and Aspect

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

A rendered Video block: a poster image behind a message that the content is hosted by YouTube and a Load YouTube content button, with a caption under it

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)TypeRequiredDefaultAllowed values and validationWhat it does
Provider (provider)SelectYesNoneupload, youtube, vimeoWhere the video comes from.
Url (url)Text inputYes for youtube and vimeoEmptyUp 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 uploadYes for uploadEmptyA file up to 100 MBThe video file.
Poster (poster)Image uploadYes for upload, unless No poster is onEmptyAn image up to 10 MBThe still image shown before play. For YouTube and Vimeo it is the backdrop of the consent message.
No poster (no_poster)ToggleNoOffOn or offMeans you are not giving a poster.
Title (title)Text inputYesEmptyUp to 255 charactersNames the video for assistive technology.
Caption (caption)Text inputNoEmptyUp to 255 charactersShown under the video.
Captions Track (captions_track)File uploadNoEmptyA captions file up to 100 MBSubtitles for an uploaded video.
Aspect (aspect)SelectYes16:916:9, 4:3, 1:1, 21:9, 9:16The 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: Url and Title

The Embed block form for a Spotify address.

A rendered Embed block: a grey box with the message that the content is hosted by Spotify and a Load Spotify content button

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)TypeRequiredDefaultAllowed values and validationWhat it does
Url (url)Text inputYesEmptyUp 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 inputNoEmptyUp to 150 charactersThe 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.

The Banner Bleed block form: Image Desktop, Image Mobile, Alt, Decorative, Video Bg, Overlay color, Overlay opacity, Heading, Text, Cta label, Cta Link, Address, Min height and Alignment

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

A rendered Banner Bleed block: a tent above clouds with the heading Three seasons, one tent, a line of text and a Read the review button, wider than the text column

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)TypeRequiredDefaultAllowed values and validationWhat it does
Image Desktop (image_desktop)Image uploadNoEmptyAn image up to 10 MBThe banner picture.
Image Mobile (image_mobile)Image uploadNoEmptyAn image up to 10 MBA different picture below 768 px wide. If only one image is set, it is used on every width.
Alt (alt)Text inputYes when any image is set, unless Decorative is onEmptyUp to 255 charactersAlternative text.
Decorative (decorative)ToggleNoOffOn or offMarks the banner image as decoration.
Video Bg (video_bg)Video uploadNoEmptyA file up to 100 MBA background video drawn behind the overlay and the text. See the note below.
Overlay color (overlay_color)Text inputNoEmptyUp to 32 characters, a CSS colour such as #0b1a2bThe colour laid over the picture so text stays readable.
Overlay opacity (overlay_opacity)Number inputNo0A whole number from 0 to 100How strong the overlay is.
Heading (heading)Text inputNoEmptyUp to 255 charactersThe banner heading.
Text (text)Rich text, bold, italic, strikethrough and link onlyNoEmptyInline textA line under the heading.
Cta label (cta_label)Text inputNoEmptyUp to 64 charactersThe words on the button.
Cta Link (cta_link)Link pickerNoEmptyAddress, Post, Category or TagWhere 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 inputNoEmptyA whole number from 0 to 4000 (pixels)The least height of the banner.
Alignment (alignment)SelectYesleftleft, center, rightWhich 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: a pale blurred backdrop with the heading Three seasons, one tent, the line A quiet loop behind the headline. and a Read the review button, across the full window width

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

The same banner on a phone-width window

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.

The Banner Constrained block form with the same fields as Banner Bleed

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

A rendered Banner Constrained block: the same banner kept to the width of the text column

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.

The Banner Full block form with the same fields as Banner Bleed

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

A rendered Banner Full block: the banner across the whole width of the browser window

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.

Available for new work

UK based · PHP · Python · JS · TS. Every first call is free.