Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The key to be looked up in the flexAttributes of the order.

string category.cacheKey

Returns a string that you can use in the fragment cache. This string will change whenever the category or one its children are changed.

Example

Code Block
languagejs
linenumberstrue
... 
category.cacheKey # => "12589387317632578294"
...

category.getCategories(deep, maxDepth)

Returns an array of sub-categories of a category as objects.

Example

Code Block
languagejs
linenumberstrue
...
var categories = category.getCategories(deep,5);
...

...

Returns an array of children of a category as objects.

Example

Code Block
languagejs
linenumberstrue
...
var children = category.getChildren(deep,5);
...

...

Returns 'CategoryJsma' for a valid category.

Example

Code Block
languagejs
linenumberstrue
...
var className = category.getClassName;

if (className !== "CategoryJsma") {
  return false;
}
...

...

Returns an array of contents of a category

Example

Code Block
languagejs
linenumberstrue
...
var contents = category.getContents(deep,5);
...

...

Returns an array of files of a category

Example

Code Block
languagejs
linenumberstrue
...
var files = category.getFiles(deep,5);
...

...

Returns the highest price iterating through all sub-categories with a depth equal to the provided parameter.

Example

Code Block
languagejs
linenumberstrue
Object.defineProperty(this, "highestPrice", {
  get : function () {
	return Math.round(self.categoryJsma.getHighestPrice(5) * 100);
  }
});

...

Returns the lowest price iterating through all sub-categories with a depth equal to the provided parameter.

Example

Code Block
languagejs
linenumberstrue
Object.defineProperty(this, "lowestPrice", {
  get : function () {
	return Math.round(self.categoryJsma.getLowestPrice(5) * 100);
  }
});

...

Returns an array of portals of a category

Example

Code Block
languagejs
linenumberstrue
...
var portals = category.getPortals(deep,5);
...

...

Returns an array of portals of a category

Example

Code Block
languagejs
linenumberstrue
...
var products = category.getProducts(deep,5);
...

...

Returns a boolean value depending on whether key is present for a given category

Example

Code Block
languagejs
linenumberstrue
...
if (category.has("description") === true)
{
  ...
}
...

...

Same as category.getHighestPrice(0). Returns the highest price of a category's immediate children.

Example

Code Block
languagejs
linenumberstrue
Object.defineProperty(this, "highestPriceNoDepth", { 
  get : function () { 
    return Math.round(self.categoryJsma.highestPrice * 100); 
  } 
});

...

Returns the actual main image of a category as an object (JSMA file).

Example

Code Block
languagejs
linenumberstrue
...
var image = category.image;

if (image) {
this.categoryImage.attr("src", "/static/image/get?id=" + image.uuid + "&size=" + this.previewMaxWidth + "x" + this.previewMaxHeight");
}
...

...

Increases the value of any flex attribute by 1 permanently. If two or more persons call this method at the same time, they will not receive the same value.

Example

Code Block
languagejs
linenumberstrue
...
category.increment("amount")
...

...

Returns true when the content type of a category is "Any"

Example

Code Block
languagejs
linenumberstrue
...
if (category.isAny === true)
{
  ...
}
...

...

Returns true when the content type of a category is "Category"

Example

Code Block
languagejs
linenumberstrue
...
if (category.isCategories === true)
{
  ...
}
...

...

Returns true when the content type of a category is "Content"

Example

Code Block
languagejs
linenumberstrue
...
if (category.isContents === true)
{
  ...
}
...

...

Returns true when the content type of a category is "File"

Example

Code Block
languagejs
linenumberstrue
...
if (category.isFiles === true)
{
   ...
}
...

...

Returns true when a category is a leaf

Example

Code Block
languagejs
linenumberstrue
...
if (category.isLeaf === true)
{
  ...
}
...

...

Returns true when a category is a mixed node

Example

Code Block
languagejs
linenumberstrue
...
if (category.isMixed === true)
{
  ...
}
...

...

Returns true when a category is a node

Example

Code Block
languagejs
linenumberstrue
...
if (category.isNode === true)
{
  ...
}
...

...

Returns true when the content type of a category is "Portal"

Example

Code Block
languagejs
linenumberstrue
...
if (category.isPortals === true)
{
  ...
}
...

...

Returns true when the content type of a category is "Product"

Example

Code Block
languagejs
linenumberstrue
...
if (category.isProducts === true)
{
  ...
}
...

...

Same as category.getLowestPrice(0). Returns the lowest price of a category's immediate children.

Example

Code Block
languagejs
linenumberstrue
...
if (category.lowestPrice === true)
{
  ...
}
...

...

Changes the index of a child within a category (e.g. for sorting purposes).

Example

Code Block
languagejs
linenumberstrue
...
category.moveChild(child, 7)
...

...

Returns the FQN of a category.

Example

Code Block
languagejs
linenumberstrue
...
var fqn = category.name;

...

...

Returns the node type of a category - Node, Mixed or Leaf

Example

Code Block
languagejs
linenumberstrue
...
if (category.nodeType == "CONTENT")
{
  ...
}
...

...

Returns an array containing the preview images of a category as objects. Works the same way as category.image for preview images.

Example

Code Block
languagejs
linenumberstrue
...
var previewImageId = null;
        
if (category.previewImages && category.previewImages.length > 0) 
{
  previewImageId = category.previewImages[0].uuid;        
}
...

...

Returns all product FQNs from immediate child products in a category without iterating through sub-categories.

Example

Code Block
languagejs
linenumberstrue
...
function categoryContainsProduct(category, productName)
{
  var productNames = category.productNames;
  var found = false;

  if (productNames && productNames.length > 0) 
  {
    for (var j = 0; j < productNames.length; j++) 
    {
       if (productName === productNames[j]) 
      {
        found = true;
        break;
      }
    }         
  }

  return found;
}
...

...

Returns products contained in a category without iterating through sub-categories (i.e. immediate children with className = 'ProductJsma') as objects.

Example

Code Block
languagejs
linenumberstrue
...
var prods = category.products;
...

...

Removes the key from the flexAttributes of the category

Example

Code Block
languagejs
linenumberstrue
...
category.remove(key)
...

...

Removes a child from a category.

Example

Code Block
languagejs
linenumberstrue
...
category.removeChild(child)
...

...

Sets the value of a specified key for a given category.

Example

Code Block
languagejs
linenumberstrue
...
category.set("description", "Anhänger mit Gravur");
...

...

Sets a category's content type.

Example

Code Block
languagejs
linenumberstrue
...
category.setContentType("CONTENT");
...

...

Sets a category's description.

Example

Code Block
languagejs
linenumberstrue
...
category.setDescription("Anhänger");
...

...

category.setName(value)

Sets a category's name.

Example

Code Block
languagejs
linenumberstrue
...
category.setName("Fotobuch");
...

...

Sets a category's node type.

Example

Code Block
languagejs
linenumberstrue
...
category.setNodeType("LEAF");
...

...

Sets a category's short description.

Example

Code Block
languagejs
linenumberstrue
...
category.setShortDescription("Anhänger")
...

...

Retrieves a category's short description string.

Example

Code Block
languagejs
linenumberstrue
...
var sDesc = category.shortDescription;
...

...

Retrieves a category's unprocessed short description string.

Example

Code Block
languagejs
linenumberstrue
...
var shortDesUnproc = category.shortdescriptionUnprocessed;
...

...

Info
titleSlice aware

This entity is slice aware, which means that to use this facility:

  • there must be a logged in user in the context of the execution
  • this user must be currently within a slice
  • this user must have the necessary privileges to edit the entity (IFE → System → Benutzer → Roles → Content-Management)

Example

Code Block
languagejs
linenumberstrue
...
var sliceID = category.sliceId;
...

...

Retrieves a category's title.

Example

Code Block
languagejs
linenumberstrue
...
if (category.title == "Fotobuch")
{
  ...
}
...

...

Updates a category with the given options.

Example

Code Block
languagejs
linenumberstrue
...
category.update(options);
...

...

Retrieves a category's UUID.

Example

Code Block
languagejs
linenumberstrue
...
var catUUID = category.uuid;
...

...