agentsclimarketplace

Media management

Skill ColdBox/skills/contentbox-cfml/media-management

Use this skill when implementing ContentBox media workflows, including uploads, storage abstraction with cbfs, image handling/resizing, media delivery patterns, and governance/security controls for assets.From its SKILL.md

Install
npx -y skills add ColdBox/skills --skill media-management

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

3.7 KB, 844 tokens by cl100k_base, as published. Nobody here has run it

ContentBox Media Management (CFML)

Work with the ContentBox media manager using CFML. Handle file uploads, image processing, media library organization, and media delivery.

Media Manager Overview

The media manager is accessible via the admin at cbadmin/mediamanager and provides:

  • File upload and management
  • Image cropping and resizing
  • Folder organization
  • File type validation
  • Media delivery via __media route

Media Service

property name="mediaService" inject="mediaService@contentbox";

// Upload files
mediaService.upload( file, folder )

// Find media
mediaService.findBySlug( slug )
mediaService.findByPath( path )
mediaService.findAll( criteria )

// Delete media
mediaService.delete( media )

// Get media URL
mediaService.getMediaURL( media )

Media Entity

// Media properties
media.getMediaID()
media.getSlug()
media.getFileName()
media.getFileExtension()
media.getFileSize()
media.getMimeType()
media.getFilePath()
media.getMediaURL()
media.getThumbnailURL()
media.getWidth()
media.getHeight()
media.getAltText()
media.getCreatedDate()
media.getModifiedDate()

Media Delivery

Media is served via the __media route:

GET /__media/:slug
GET /__media/:slug/:size

Image Sizes

ContentBox supports on-the-fly image resizing:

// In views
<img src="#cb.mediaURL( media, 'thumbnail' )#" alt="#media.getAltText()#">
<img src="#cb.mediaURL( media, 'medium' )#" alt="#media.getAltText()#">
<img src="#cb.mediaURL( media, 'large' )#" alt="#media.getAltText()#">

File Browser Integration

ContentBox integrates with file browser modules for CKEditor and other editors:

// File browser module name (configurable)
property name="moduleSettings" inject="coldbox:moduleSettings:contentbox";
var fileBrowserModule = moduleSettings.contentbox.filebrowser_module_name;

Media in Content

Media can be embedded in entry/page content:

<!--- Image in content --->
<img src="#cb.mediaURL( media )#" alt="Description">

<!--- With specific size --->
<img src="#cb.mediaURL( media, 'thumbnail' )#" alt="Description">

CBHelper Media Methods

property name="cb" inject="CBHelper@contentbox";

// Get media URL
cb.mediaURL( media )
cb.mediaURL( media, "thumbnail" )
cb.mediaURL( media, "medium" )
cb.mediaURL( media, "large" )

// Get media path
cb.mediaPath( media )

Media Storage

Media is stored using cbfs (ContentBox File System):

property name="diskService" inject="DiskService@cbfs";

// Get the contentbox disk
var disk = diskService.get( "contentbox" );

// Disk configuration
// Path: expandPath( settingService.getSetting( "cb_media_directoryRoot" ) )
// URL: siteRoot & "/modules_app/contentbox-custom/_content"

Best Practices

  1. Use cb.mediaURL() for all media URL generation
  2. Set alt text for accessibility
  3. Use appropriate sizes — thumbnail, medium, large
  4. Validate file types — check MIME types before processing
  5. Organize with folders — use folder structure for large media libraries
  6. Handle missing media — gracefully handle deleted or missing files
  7. Use cbfs for storage — leverage the disk service for file operations
  8. Clean up orphaned media — remove unused files periodically

Engine Compatibility

This skill targets CFML engines (Lucee 5+, Adobe ColdFusion 2018+). For BoxLang-specific syntax and features, see the BoxLang variant of this skill.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 326,782. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.