Skip to main content

BucketTemplates

Overview​

1. AccPack_BucketTemplates​

The AccPack_BucketTemplates determines which buckets need to be placed and places a sub-template for each one. Each sub-template is linked to the correct bucket. This placeholder allows traversal of the bucket tree to find matching buckets — making it more flexible than ChildBucketTemplates, which only evaluates direct children.

2. Architectural Decision: BucketTemplates vs. ChildBucketTemplates​

Choosing the correct multiframe placeholder depends on how deep the system needs to look for data:

  • AccPack_ChildBucketTemplates: Use this when you only need to evaluate the direct children of the currently linked bucket.

  • AccPack_BucketTemplates: This is a more advanced version that offers greater control. It allows for traversal of the bucket tree (up or down) to find matching buckets rather than being restricted to direct children.

Typical Use Case: A common scenario involves placing article templates inside a product group view. If a layout is linked to a high-level product group, BucketTemplates can "descend" through the hierarchy to find all articles belonging to that group—even if they are nested several levels deep—and place a sub-template for each one.


Technical Specification​

Placeholder type: Multiframe

Entity: Works with planning records and bucket records

Function Variables​

  • Level: Defines the traversal logic:

    • descend: Goes down the tree to find an exact match with the result entity.
    • ascend: Goes up the tree to find an exact match with the result entity.
    • current: Links the sub-template to the current item without moving up or down.
    • custom: Allows configuring the exact number of steps (e.g., +1, -2) to take in the entity tree.
  • Template: The sub-template built for each identified bucket.

  • FormatString: Configures a custom format string for the multiframe.

  • Result Entity ID: Only buckets of this specific type will be built; this is effective only for descend, ascend, or custom levels.

Developer Specifications​

  • Data Query: com.priint.accpack.placeholder.dataquery.BucketQueryPlugin.getChildrenBucketOrPlannedBucketByLevel.

  • Data Mapping: com.priint.pubserver.comet.bridge.datamapping.DataMappingToElement.bucketsToElements.

  • Data Processing:

    • com.priint.pubserver.comet.bridge.dataprocessing.setTemplate: Sets the template for each element.

    • com.priint.accpack.placeholder.dataprocessing.setFormatString: Sets the format string for each element.


Global Configuration Logic​

1. Context Definition​

Generic placeholders default to using the _language and _country parameters.

  • Static Value Reset: If a placeholder must be language-neutral, the value can be reset using the staticValue Context Rule.

  • Mixed Usage: The useDocumentVariableWithEntityCheck rule can be used to automatically skip context if an entity (like a global image) is not dynamic.

2. Selection Variable Logic​

When a planning record is assigned, the Selection variable controls behavior:

  • Ignore selected content: Every key-value record is recognized, ignoring planner selections.

  • Only selected content: Only returns values specifically selected in the planning record.

  • Use all if no content selected: Acts as the fallback state, returning all available records.


Technical Environment & Deployment​

Consultants could find guide for deployment of generic placeholders here: installation & configuration


Demonstration & Implementation Examples​

Demo data for example:

  • Pre-defined templates:

    • AccPack Demo BucketTemplate, ID: 410523033
    • AccPack Demo Subtemplate, ID: 410523024
  • Prepared product data:

    • Product: White heart
    • Sub-product: 4833040, 4833041, 4833043
    • Key of product data to be displayed: quantity

Figure 1: Prepared data to be displayed in priint:admin

  1. Product & articles as sub-buckets
  2. Key values of key=quantity

Prepared data

Figure 2: Placeholder Options for Bucket template

  1. Template ID: 410523033
  2. Placeholder: AccPack_BucketTemplates
  3. Function variables:
    • Level: descend (system will look up the sub level of the rendered product)
    • Template: AccPack Demo Subtemplate (the placeholder calls template AccPack Demo Subtemplate as subtemplate to be displayed)

Bucket template Placeholder options

Figure 3: Placeholder Options for Subtemplate

  1. Template ID: 410523024
  2. Placeholder: AccPack_AttributeKeyValue
  3. Function variables:
    • Key: Custom, value: quantity (the key value of attribute with key=quantity will be displayed)
    • Other variables are set as default

Subtemplate Placeholder options

Figure 4: Result (displayed data of quantity for each sub-bucket defined in the sub-template)

KeyValue Result

Figure 5: Result (Placeholder Options for Bucket template)

Bucket template Placeholder options

Figure 6: Result (Placeholder Options for Sub-template inside Bucket template)

Bucket template Placeholder options


Further Reading​