HomeWiki
HomeWiki
  1. Components
  • Back to home
  • 1. Themes
  • Layout
    • New Layout
    • Legacy Layout
  • Components
    • Announcement
    • Banner Carousel
    • Banner With Products Carousel
    • Blog Category List
    • Blog List
    • Brand List
    • Brands Carousel
    • Breadcrumb
    • Call To Action
    • Cart
    • Categories List
    • Change Password
    • Checkout
    • Cookie Manager
    • Filter list
    • Footer
    • Forgot Password
    • Form
    • Hero Carousel
    • Icon Block
    • Invitation
    • Last Visited Products
    • Layout
    • Login
    • Map
    • Nav Bar
    • Offer
    • Product Attachments
    • Product Attributes
    • Product Documentation
    • Product Expected
    • Product Modal
    • Products Block
    • Products Carousel
    • Product Single
    • Profile
    • Quote
    • Register
    • Related Products
    • Search
    • Stores
    • Subscribe Newsletter
    • Text with Image
    • Top Bar
    • Video
  • Reusables
    • Getting Started
  • Assets
    • Getting Started
  • SDK
    • Products
      • _findProductsByCategory
      • _findProductsByIds
      • _findProductsByTitle
      • _findProductsByFilter
      • _findProductsByCriteria
      • _findProductsAndCalculate
      • _findProductsThenCalculate
      • _getProductAttributeSet
      • _setLastVisited
    • Categories
      • _findCategoryTreeById
      • _findCategoriesByIds
      • _findCategoryByAlias
      • _findCategoryTreeByAlias
      • _getCategoryContent
    • Collections
      • _getCollectionContent
      • _findCollectionsByIds
      • _findCollectionsByIdsThenCalculate
    • Brands
      • _getBrandContent
      • _findBrandsByIds
    • Cart
      • _addToCartMulti
      • _addToCart
      • _setCart
      • _clearCart
      • _setCartListener
      • _removeFromCart
      • _calculateCart
    • Checkout
      • _startCheckout
      • _updateCheckout
      • _completeCheckout
    • Shopping Lists
      • _getShoppingLists
      • _updateShoppingList
      • _createShoppingList
      • _deleteShoppingList
      • _getShoppingListByAlias
    • Navigation
      • _getFooterMenu
      • _getHeaderMenu
    • Users
      • _getUserById
    • Utils
      • _calculateCurrency
      • _getCurrencySymbol
      • _getCulture
      • _subscribeToNewsletter
      • _findUnitsByIds
  • Vs Code
    • Getting Started
  1. Components

Blog Category List

Documentation: Blog Category List Component#

The Blog Category List Component is a Vue.js component designed to display a list of blog categories. Each category is presented as a block with a link, title, and optional image, which directs users to the corresponding blog posts for that category.

Overview#

This component uses a model object to configure its behavior and appearance. It dynamically generates a list of blog categories, with each category represented as a clickable block.

Model Documentation#

The model object should include configuration details used by the component:
Model Structure#
id: String
A unique identifier for the component, used as the id attribute in the HTML.
cssClass: String
Optional CSS class(es) for additional styling of the container element.
header: String
Optional header text to be displayed above the list of blog categories.
Example Model#
{
  "id": "blog-category-list-1",
  "cssClass": "custom-blog-category-list",
  "header": "Blog Categories"
}

Component Structure#

The component uses Vue.js to manage dynamic data and rendering based on the model and the fetched blog categories.

HTML Template#

The HTML template for the component is as follows:

JavaScript#

The JavaScript part of the component handles data fetching and component logic:

Explanation#

1.
Props:
model: The component receives a model object as a prop, which contains configuration and data for rendering.
2.
Data:
blogCategoryList: An array that will store the list of blog categories retrieved from an external source.
3.
Mounted Lifecycle Hook:
mounted(): Invokes a method _getBlogCategoryList to fetch the list of blog categories when the component is mounted. The result is assigned to the blogCategoryList data property.
4.
Methods:
Methods Section: Currently empty but can be used for additional functionality if needed.

Usage#

To use the Blog Category List Component:
1.
Define the Vue Component:
Use Vue.component() or app.component() to register the component.
2.
Create the Template:
Structure the HTML with Vue.js directives (v-if, v-for, :href, etc.) for dynamic rendering.
3.
Implement JavaScript Logic:
Define props for the model object.
Initialize data and implement methods for data fetching and logic.
Use the mounted() lifecycle hook to fetch data when the component is loaded.
4.
Customize Styling and Layout:
Adjust CSS classes and styles according to your design requirements.
5.
Test and Debug:
Ensure the component functions correctly in various scenarios and screen sizes.
Debug any issues related to data binding or rendering.
6.
Deploy the Component:
Integrate the component into your Vue.js application and deploy it as part of your project.
This documentation provides a comprehensive guide to implementing and using the Blog Category List Component, including model requirements, component structure, and example usage.
Previous
Banner With Products Carousel
Next
Blog List
Built with