Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/emmanueljarquin-sys/GrupoMecsaCMS/llms.txt

Use this file to discover all available pages before exploring further.

Overview

The Media Library provides centralized storage and management for all media files. Upload images, videos, audio files, and documents with metadata and folder organization.

Key Features

Multiple File Types

Images, videos, audio, PDFs, and documents

Folder Organization

Organize media in custom folders

Metadata

Alt text, captions, and tags for searchability

Supabase Storage

Secure cloud storage with CDN

Supported File Types

media.php
"allowed_mime_types" => [
    "image/*",
    "video/*",
    "audio/*",
    "application/pdf",
    "application/msword",
    "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
]

Upload Process

1

Access Media Library

Navigate to Media Library from sidebar.
2

Select Folder

Choose destination folder or create new one.
3

Upload File

  • Select file from computer
  • Add alt text (for images)
  • Add caption (optional)
  • Add tags (optional)
4

Save

File is uploaded to Supabase Storage.

File Storage

media.php
$bucket_name = 'media_cms';
$storage_path = $folder_name . "/" . $filename;

$res_upload = supabase_request_service('POST', 
    "/storage/v1/object/media_cms/$storage_path", 
    $file_content
);
Files are stored in: media_cms/[folder]/[filename]

Image Processing

media.php
if ($file_type === 'image') {
    $image_info = getimagesize($file['tmp_name']);
    if ($image_info) {
        $dimensions = [
            'width' => $image_info[0], 
            'height' => $image_info[1]
        ];
    }
}
Automatically captures image dimensions.

Database Tables

Media Files: cms_media
ColumnTypeDescription
idintegerPrimary key
filenametextOriginal filename
storage_pathtextSupabase path
file_typetextimage/video/audio/document
mime_typetextMIME type
file_sizeintegerSize in bytes
dimensionsjsonbWidth/height for images
alt_texttextAlt text
captiontextCaption
tagstextSearch tags
folder_idintegerFolder FK
Folders: cms_media_folders
ColumnTypeDescription
idintegerPrimary key
nametextFolder name
parent_idintegerParent folder (nullable)

Next Steps

Content

Use media in content

Blog

Add images to blog posts

Build docs developers (and LLMs) love