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

Product Documentation

Documentation: Product Documentation Component#

The Product Documentation Component is designed to display product-related documentation in a structured format. It can handle various content layouts and adapt to different visual requirements based on the model configuration.

Overview#

The Product Documentation Component provides a flexible way to display product documentation content. It supports alternating content layouts for images and text, dynamically adjusts the layout based on provided model data, and handles errors in image loading gracefully.

Model Documentation#

The model object for the Product Documentation Component includes configuration properties that determine how the component should display its content.
Model Structure#
id: String
A unique identifier for the component, used for element targeting and styling.
cssClass: String
Optional CSS class(es) to apply to the component's container.
view: String
Determines the layout of the content:
"Left": Image on the left, text on the right.
"Right": Image on the right, text on the left.
Example Model#
{
  "id": "productDocumentation",
  "cssClass": "documentation-class",
  "view": "Left"
}

Component Structure#

The Product Documentation Component includes:
1.
HTML Template: Defines the structure for displaying documentation lines with alternating layouts.
2.
JavaScript: Manages data fetching, layout adjustments, and error handling for images.

HTML Template#

The HTML template iterates over the documentation.lines array and displays each line's content. The layout alternates between image and text based on the index of the line.

JavaScript#

The JavaScript section handles data fetching, layout configuration, and image error handling.

Explanation#

Data Handling: On component mount, the _getProductContent method is used to fetch documentation data based on the product ID. The retrieved data is assigned to the documentation variable.
Layout Configuration: Depending on the view property, the layout of the image and text is adjusted using different CSS classes.
Error Handling: The _handleImageError method is defined to handle image loading errors by setting a fallback image.

Usage#

To use the Product Documentation Component in your Vue.js application:
1.
Register the Component: Ensure the ProductDocumentation component is registered in your Vue app.
2.
Pass the Model: Provide a model object to configure the component’s appearance and behavior.
3.
Include the Component: Use the ProductDocumentation component in your Vue template with the appropriate model data.
Previous
Product Attributes
Next
Product Expected
Built with