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 Blog module allows you to create, manage, and publish blog posts for your website. Each post supports hierarchical categorization, featured images, rich text content, and full CRUD operations.Key Features
Post Management
Create, edit, and delete blog posts
Category System
Organize posts with hierarchical categories
Pagination
Browse posts with configurable page sizes
Rich Content
Support for HTML content and formatting
Post Structure
Each blog post includes:- Title: Post headline
- Content: Rich text body (supports HTML)
- Category: Hierarchical category assignment
- Featured Image: Optional post thumbnail/hero image
- Author: Post author information
- Publish Date: Timestamp for scheduling
- Status: Draft or Published
Creating a Blog Post
Enter Post Details
Fill in the required fields:
- Title: Post headline
- Content: Main post body (HTML supported)
- Category: Select from hierarchical dropdown
- Featured Image: Upload post thumbnail
- Status: Draft or Published
Fetching Posts
Posts are retrieved with pagination:blog.php
Category System
Blog posts use the same hierarchical category system as content:blog.php
Category Dropdown Display
Categories are rendered hierarchically in the post editor:Post Listing
Posts are displayed in reverse chronological order (newest first):- Title and excerpt
- Category badge
- Author and publish date
- Status indicator (Draft/Published)
- Edit and Delete actions
Pagination Controls
blog.php
- Previous/Next navigation
- Page number links
- Rows per page selector (5, 10, 20, 50)
- Current page indicator
Post Editor
The post editor supports:- Rich Text: HTML formatting
- Media Embedding: Images, videos
- Code Blocks: Syntax highlighting
- Links: Internal and external
- Lists: Ordered and unordered
The blog editor supports full HTML, allowing you to embed custom elements and styles.
Publishing Workflow
- Draft Mode
- Immediate Publish
- Create post
- Save as draft
- Review and edit
- Publish when ready
Post Record Structure
Editing Posts
Deleting Posts
To delete a post:- Click the delete button
- Confirm the deletion
- Post is permanently removed from the database
Database Table
Table Name:posts
| Column | Type | Description |
|---|---|---|
id | integer | Primary key |
title | text | Post title |
content | text | Post body (HTML) |
categoria | integer | Category ID |
featured_image | text | Image storage path |
author | text | Author name |
status | text | Draft or Published |
created_at | timestamptz | Creation timestamp |
updated_at | timestamptz | Last update timestamp |
API Endpoints
- GET
/rest/v1/posts- List posts - GET
/rest/v1/posts?select=*&order=created_at.desc&limit=10&offset=0- Paginated posts - POST
/rest/v1/posts- Create post - PATCH
/rest/v1/posts?id=eq.{id}- Update post - DELETE
/rest/v1/posts?id=eq.{id}- Delete post
SEO Considerations
For better search engine optimization:- Use descriptive, keyword-rich titles
- Include meta descriptions in post content
- Optimize featured images (alt text, file size)
- Use proper heading hierarchy (H1, H2, H3)
- Add internal links to related posts
Best Practices
Content Quality
Write engaging, valuable content for your audience
Consistent Publishing
Maintain a regular posting schedule
Image Optimization
Compress images before upload for faster loading
Category Organization
Use clear, logical category structures
Troubleshooting
Post Not Displaying
Problem: Published post not showing on website Possible causes:- Status still set to “Draft”
- Caching issues
- Category permissions
Image Upload Issues
Problem: Featured image fails to upload Solutions:- Check file size limits (
upload_max_filesize) - Verify file format (JPEG, PNG, WebP)
- Check Supabase Storage bucket permissions
Category Selection Error
Problem: “Selecciona una categoría válida” Solution: Ensure a category is selected from the dropdown before submitting.Related JavaScript
Blog functionality is enhanced bymainblog.js:
- Post creation forms
- WYSIWYG editor integration
- Image upload handling
- Draft auto-save
- Preview functionality
Next Steps
Content
Manage general content
Dashboard
View blog statistics