VOOZH about

URL: https://deepwiki.com/MahoCommerce/maho/13.1-blog-module

⇱ Blog Module | MahoCommerce/maho | DeepWiki


Loading...
Last indexed: 15 May 2026 (ea8ab8)
Menu

Blog Module

The Maho Blog module provides a native, integrated blogging system for the Maho e-commerce platform. Unlike traditional Magento installations that often rely on third-party extensions, Maho includes a high-performance blog system built directly into the core. It features an EAV-based storage model for posts, a hierarchical category system, SEO-friendly URL management, and full integration with Maho's sitemap and search capabilities.

Architecture and Data Storage

The blog system utilizes a hybrid storage approach. While it leverages the Entity-Attribute-Value (EAV) system for flexibility, it optimizes performance by storing frequently accessed "static" attributes directly in the main entity tables.

Entity Models

  • Post (blog_post): The primary content entity representing blog posts. Posts support multi-store assignment through the blog_post_store table with resource and model classes clearly defined. The EAV setup uses Mage_Eav_Model_Entity_Setup for schema management app/code/core/Maho/Blog/etc/config.xml27-32 app/code/core/Maho/Blog/etc/config.xml59-64
  • Category (blog_category): Organizes blog posts in a hierarchical manner. Categories have parent-child relations stored using a path attribute. Categories also support store view restrictions app/code/core/Maho/Blog/controllers/IndexController.php36-49
  • Storage Tables: Includes several key tables:
    • blog_post_entity: Holds main blog post entities.
    • blog_post_store: Associates posts with store views.
    • blog_category_entity: Stores category entities.
    • blog_category_store: Store restrictions for categories.
    • blog_post_category: Many-to-many link between posts and categories.
    • blog_eav_attribute: Additional EAV attribute metadata app/code/core/Maho/Blog/etc/config.xml26-45

Logic Flow: Post Loading and Rendering

This diagram illustrates the typical flow for a frontend blog post request, highlighting major code entities involved from routing to layout rendering and event observation:


Sources: app/code/core/Maho/Blog/controllers/IndexController.php62-84 app/code/core/Maho/Blog/Model/Observer.php16-27

Frontend Display

The frontend presentation layer includes listings of posts, filtering by category, and detailed post views. The module integrates tightly with Maho's layout and breadcrumb navigation systems.

Navigation Integration

Controller Actions Summary

The Maho_Blog_IndexController exposes the primary frontend routes for the blog:

Action NameURL RouteDescription
indexAction/blogDisplays main blog post listing
categoryAction/blog/index/categoryLists posts filtered by selected category
viewAction/blog/index/viewDisplays a single blog post with SEO meta

Each action verifies module enablement and active category/post status, handles store view checks, sets page titles, metadata, breadcrumbs, and renders the layout app/code/core/Maho/Blog/controllers/IndexController.php15-84

Sitemap and SEO

The blog module is integrated with Maho's sitemap system to boost SEO and content discoverability.

Sitemap Generation

  • The observer Maho_Blog_Model_Observer::addBlogToSitemap listens to the sitemap event sitemap_urlset_generating_before and injects blog URLs including:
    • The blog main listing page.
    • Active blog posts.
    • Categories (if enabled).
  • It respects per-store configurations for priority, change frequency, and optionally includes post images in sitemap XML app/code/core/Maho/Blog/Model/Observer.php80-144
  • Sitemap resource models use SQL constructs compatible across supported databases (MySQL, PostgreSQL, SQLite), employing CASE expressions for store value fallback consistency app/code/core/Mage/Sitemap/Model/Resource/Catalog/Product.php84-112

URL Management

The module supports configurable URL prefixing for both blog posts and blog categories via the system configuration, allowing URLs like /blog/post-slug and /blog/category/category-slug app/code/core/Maho/Blog/etc/config.xml143-150

Admin and API Interface

Admin Management

  • Post Management: Handled by the controller Maho_Blog_Adminhtml_Blog_PostController supporting CRUD operations, form processing, and ACL-secured access.
  • The admin UI enables assigning posts to stores and categories, editing SEO-related fields, and status management.
  • ACL resources are defined in the module's config.xml under system/api/blog_post to govern who can manage blog content app/code/core/Maho/Blog/etc/config.xml68-95

JSON-RPC API

  • Maho exposes a JSON-RPC API for external integration with blog posts.
  • Available methods include:
    • list: Retrieve blog posts list.
    • info: Get detailed post info.
    • create: Create a new blog post.
    • update: Modify existing post.
    • remove: Delete a post.
  • The API defines ACL restrictions consistent with backend permissions and supports SOAP/JSON-RPC v2 through function prefix mappings app/code/core/Maho/Blog/etc/config.xml73-104

Blog Code Entity Map

This class diagram illustrates key classes and their relations within the blog module:


Sources: app/code/core/Maho/Blog/etc/config.xml18-57 app/code/core/Maho/Blog/controllers/IndexController.php12-13 app/code/core/Maho/Blog/Model/Observer.php14-144


Summary:

The Maho Blog module tightly integrates a flexible, store-aware blogging system into the Maho platform, leveraging EAV for extensibility, layered caching and store view fallbacks for performance and versatility, strong frontend presentation with navigation and breadcrumbs, admin management with ACL controls, sitemap inclusion for SEO, and a rich JSON-RPC API for external integration.

Sources: