CategoryDTO Object

Overview

The REST API makes extensive use of the CategoryDTO object whenever working with a single category.  This article will help you to know the various members of this object.

Requirements

The following pre-requisites will be necessary to accomplish the goals of this article:

  • General understanding of REST and API’s
  • Understanding of C# and/or JavaScript

Getting Started

There are no tasks needed to get started with understanding this object. 

CategoryDTO

The CategoryDTO object will contain all of the details of a single category for your Hotcakes Commerce store.

Members

The following table gives you details on the various members of the CategoryDTO object.  The descriptions are based upon default functionality and the default Viewset included with Hotcakes.

Member Default Description
BannerImageUrl (empty string) If populated with a URL, the specified banner will be displayed in the category header.
Bvin (empty string) This is the ID of the category.
CustomPageOpenInNewWindow False If true and if using a category as a custom link, this will cause the link to be opened in a new window when the customer clicks on it. This is only used in the CategoryRotator content block.
CustomPageUrl (empty string) If populated with a URL, this value will be used as the URL for the category when clicked.
Description (empty string) If the description exists, it will be placed below the category banner.
DisplaySortOrder ManualOrder (1) Except when overridden by a “sort” querystring parameter, this value determines how the products in the category will be sorted.
Hidden False If true, the category will be hidden from the customer’s view.
ImageUrl (empty string) This is the image of the category that you want associated with it in the various views. It also is used to generate the category thumbnail.
Keywords (empty string) These keywords are additional keywords that can be used to further enhance your onsite search to find products in this category.
LastUpdatedUtc UtcNow The last updated date is used for auditing purposes to know when the category was last updated.
MetaDescription (empty string) This description is used to adjust the description in the source code of the category landing page for SEO.
MetaKeywords (empty string) These keywords are used to adjust the keywords in the source code of the category landing page for SEO.
MetaTitle (empty string) This title is used to adjust the title in the source code of the category landing page for SEO.
Name (empty string) This is the name of the category that the customers will see in their views.
Operations Null Operations allow you to define external API endpoints that can be used to manage the category.
ParentId (empty string) Having an ID here will make this category a child or nested category of the category that matches this ID. This helps to create nested navigation and other features.
PostContentColumnId (empty string) Contains the ID of the content block that you want to use in the footer area of the category. Leave empty if you do not want to have a header.
PreContentColumnId (empty string) Contains the ID of the content block that you want to use in the footer area of the category. Leave empty if you do not want to have a header.
RewriteUrl (empty string) This is the slug of the URL, or the last part of the URL to be used to get to this category's landing page. It must be unique. If empty, the application will create one based upon the name of the category.
ShowInTopMenu False If true, this category will be shown in the initial list of categories in category lists.
ShowTitle True If true, the category name is shown in the customer-facing views.
SortOrder 0 Allows you to define how the products in this category will be ordered. The possible values are:
  • None = 0
  • ManualOrder = 1
  • ProductName = 2
  • ProductPriceAscending = 3
  • ProductPriceDescending = 4
  • ManufacturerName = 5
SourceType Manual (0) Allows you to define whether your category is a typical category or a placeholder link to another resource. The possible values are:
  • Manual = 0
  • Custom = 2
  • DrillDown = 4
StoreId 0 This is the ID of the Hotcakes store. Typically, this is 1, except in multi-tenant environments.
TemplateName “Index” Allows you to specify a specify view in your viewset to be associated with this category when customers see it.

 

Example of CategoryDTO

{
   "Errors":[

   ],
   "Content":{
      "Bvin":"a928e73f-120a-42ca-89e1-410ab268fb69",
      "Name":"Awesome Products",
      "Description":"These are the most awesome products!",
      "LastUpdatedUtc":"/Date(1395782131104)/",
      "StoreId":1,
      "ParentId":"",
      "DisplaySortOrder":1,
      "SourceType":0,
      "SortOrder":6,
      "MetaKeywords":"",
      "MetaDescription":"",
      "MetaTitle":"",
      "ImageUrl":"",
      "BannerImageUrl":"",
      "CustomPageUrl":"",
      "CustomPageOpenInNewWindow":false,
      "ShowInTopMenu":false,
      "Hidden":false,
      "TemplateName":"Index",
      "PreContentColumnId":"",
      "PostContentColumnId":"",
      "ShowTitle":true,
      "Keywords":"",
      "RewriteUrl":"awesome-products",
      "Operations":[

      ]
   }
}
Have more questions? Submit a request

Need More Help?

Do you need more assistance with this article? Please review your support options.