...
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 |
---|
language | js |
---|
linenumbers | true |
---|
|
...
category.cacheKey # => "12589387317632578294"
... |
category.getCategories(deep, maxDepth)
Returns an array of sub-categories of a category as objects.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
var categories = category.getCategories(deep,5);
... |
...
Returns an array of children of a category as objects.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
var children = category.getChildren(deep,5);
... |
...
Returns 'CategoryJsma' for a valid category.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
var className = category.getClassName;
if (className !== "CategoryJsma") {
return false;
}
... |
...
Returns an array of contents of a category
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
var contents = category.getContents(deep,5);
... |
...
Returns an array of files of a category
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
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 |
---|
language | js |
---|
linenumbers | true |
---|
|
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 |
---|
language | js |
---|
linenumbers | true |
---|
|
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 |
---|
language | js |
---|
linenumbers | true |
---|
|
...
var portals = category.getPortals(deep,5);
... |
...
Returns an array of portals of a category
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
var products = category.getProducts(deep,5);
... |
...
Returns a boolean value depending on whether key is present for a given category
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
if (category.has("description") === true)
{
...
}
... |
...
Same as category.getHighestPrice(0). Returns the highest price of a category's immediate children.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
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 |
---|
language | js |
---|
linenumbers | true |
---|
|
...
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 |
---|
language | js |
---|
linenumbers | true |
---|
|
...
category.increment("amount")
... |
...
Returns true when the content type of a category is "Any"
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
if (category.isAny === true)
{
...
}
... |
...
Returns true when the content type of a category is "Category"
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
if (category.isCategories === true)
{
...
}
... |
...
Returns true when the content type of a category is "Content"
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
if (category.isContents === true)
{
...
}
... |
...
Returns true when the content type of a category is "File"
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
if (category.isFiles === true)
{
...
}
... |
...
Returns true when a category is a leaf
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
if (category.isLeaf === true)
{
...
}
... |
...
Returns true when a category is a mixed node
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
if (category.isMixed === true)
{
...
}
... |
...
Returns true when a category is a node
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
if (category.isNode === true)
{
...
}
... |
...
Returns true when the content type of a category is "Portal"
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
if (category.isPortals === true)
{
...
}
... |
...
Returns true when the content type of a category is "Product"
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
if (category.isProducts === true)
{
...
}
... |
...
Same as category.getLowestPrice(0). Returns the lowest price of a category's immediate children.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
if (category.lowestPrice === true)
{
...
}
... |
...
Changes the index of a child within a category (e.g. for sorting purposes).
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
category.moveChild(child, 7)
... |
...
Returns the FQN of a category.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
var fqn = category.name;
... |
...
Returns the node type of a category - Node, Mixed or Leaf
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
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 |
---|
language | js |
---|
linenumbers | true |
---|
|
...
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 |
---|
language | js |
---|
linenumbers | true |
---|
|
...
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 |
---|
language | js |
---|
linenumbers | true |
---|
|
...
var prods = category.products;
... |
...
Removes the key from the flexAttributes of the category
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
category.remove(key)
... |
...
Removes a child from a category.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
category.removeChild(child)
... |
...
Sets the value of a specified key for a given category.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
category.set("description", "Anhänger mit Gravur");
... |
...
Sets a category's content type.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
category.setContentType("CONTENT");
... |
...
Sets a category's description.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
category.setDescription("Anhänger");
... |
...
category.setName(value)
Sets a category's name.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
category.setName("Fotobuch");
... |
...
Sets a category's node type.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
category.setNodeType("LEAF");
... |
...
Sets a category's short description.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
category.setShortDescription("Anhänger")
... |
...
Retrieves a category's short description string.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
var sDesc = category.shortDescription;
... |
...
Retrieves a category's unprocessed short description string.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
var shortDesUnproc = category.shortdescriptionUnprocessed;
... |
...
Info |
---|
|
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 |
---|
language | js |
---|
linenumbers | true |
---|
|
...
var sliceID = category.sliceId;
... |
...
Retrieves a category's title.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
if (category.title == "Fotobuch")
{
...
}
... |
...
Updates a category with the given options.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
category.update(options);
... |
...
Retrieves a category's UUID.
Example
Code Block |
---|
language | js |
---|
linenumbers | true |
---|
|
...
var catUUID = category.uuid;
... |
...