Hublify provides some extra enriched datasets.


FUNCTIONS - more infos to come ....

  • hublify.content(...) - For getting CDB-records.
  • hublify.contentLinkData(...) - Gets a link-data-object pointing to a given content-record.
  • hublify.contentLinkUrl(...) - Gets an absolute URL for a given content. Pretty-URL / -aliasing and page-configuration of CDB is automatically regarded.
  • hublify.contentCategory(...) - For getting CDB-categories of a CDB-catalog (=category-tree).
  • hublify.contentCategoryLinkData(...) - Gets a link-data-object pointing to a given category.
  • hublify.contentCategoryLinkUrl(...)
  • hublify.contentCategoryNext(...) - Gets the next category from CDB-catalog for a given category.
  • hublify.contentCategoryPrevious(...) - Gets the previous category from CDB-catalog for a given category.


Content

Contents are freely structured data-records stored in Hublify.

  • many (rich) field-types
  • categorizable (see below)


contentFilterFieldOptions(...)

Gets all occurring  values within a requested field.

Use this e.g. for getting values as selectable options for content (e.g. "product-field"-) "filter" that the frontend user can use.

  /**
   * Searches in records for occurring  option/values within a requested filter field.
   *
   *
   * Kind a like a comfortable SELECT DISTINCT ...
   *
   * @param string $contentType Defines in which records of which content-type (ct_label) you want to search.
   * @param string $field The field of which you want the values.
   * @param array|null $filters Optional filters you want to apply (filter the records for).
   * @param array|null $ranges Optional array of ...   yeah, well, what exactly .... ;)
   * [<n>]
   *   [min] - Float, min Value
   *   [max] - Float, max Value
   *
   * @param string|null $searchPhrase An overall full-text-search phrase that would be applied specifically to the
   *                     content-type's record search.
   *
   * @return array|null Returns a numerical array of objects
   * [<n>]
   *   [value] - string. Option value
   *   [hits] - integer. Option record counter. In how many records this "value" occurs.
   */

public function contentFilterFieldOptions(string $contentType, string $field, ?array $filters = null, ?array $ranges = null, ?string $searchPhrase = null): ?array



Content-Categories (catalogs)

Some quick infos on how Hublify manages categories.

  • All content (articles, products, ...) in Hublify can be usually assigned to (multiple) categories.
  • Categories are designated to organize your other content.
  • Categories can be structured as multi-level catalogs (="category-trees").
  • Multiple catalogs can be managed.
  • A single category is also often call "catalog node". This is the more internal technical naming.
  • A category itself has also (extendable) own fields, e.g. "name", "description", "image", ...


Standard category "detail" data

A category itself is also an own data-record that has some own detail data fields.

Additional custom fields can be configured in Hublify.

The basic preconfigured standard fields are

FieldDescriptionExample
node_code
my_first_catgory



i18n_node_path_DE

i18n_node_name_DE

i18n_node_desc_DE

i18n_node_desc_long_DE




node_imageArray of MAM-Images



cnt_item_FullPath
150
cnt_item_NodeOnly
12


Get catalog


Parameters

To your catalog-query you can optionally add parameters.

fields - array (required) Numerical array defining which fields to be returned.

filter - array (optional, default NULL) The typical filter array, to filter the categories for.

parent_code - string (optional) Provide this to get the subtree below this category-node.

parent_included - bool (optional, default FALSE) If TRUE then the parent-node will be included in the result-data, too. Use this only when parameter "parent_code" is used.

direct_childs - bool (optional, default FALSE) If TRUE then only the direct children of the parent_code-node are returned. This is like a dynamic depth_max = 1 without having to know on which depth-level the parent-node is itself. Use this only when parameter "parent_code" is used.

depth_max - integer (optional, default NULL) Maximum-Depth (1..n) of groups to return. If not given, then all groups are returned.

show_inactive - bool (optional, default FALSE) If TRUE, inactive nodes will be returned as well. Usually you will get only the set as active categories.


Get complete catalog

To retrieve a complete catalog with all its defined categories within, simply do not provide any filter-parameters

Example

{% set resultCats = hublify.contentCategory('blog_catalog')
    .fields([
        'node_code',
        'i18n_node_path_DE',
        'i18n_node_name_DE',
        'i18n_node_desc_DE',
        'i18n_node_desc_long_DE',
        'i18n_node_keywords_DE',
        'node_image',
        'cnt_item_FullPath',
        'cnt_item_NodeOnly',
    ])
    .allRich() %}


Get sub-tree of catalog

For performance reasons you might want to get only a partial sub-tree of a catalog.

For that you simply have to set the "parent_code" parameter.

Maybe you want to limit additionally the result to the direct children of parent_code then use parameter "direct_childs".

Example

{% set resultCats = hublify.contentCategory('blog_catalog')
    .fields([
        'node_code',
        'i18n_node_path_DE',
        'i18n_node_name_DE',
        'i18n_node_desc_DE',
        'i18n_node_desc_long_DE',
        'i18n_node_keywords_DE',
        'node_image',
        'cnt_item_FullPath',
        'cnt_item_NodeOnly',
    ])
    .param('parent_code', 'ExampleMyStartCatCode')
    .allRich() %}


Get Content-list assigned to a category

...


Get Content-Count for category list

...


Frontend: Filter-Fields

In each category you can define the record-fields that you want to "propose" as possible filters to the frontend-user.

Of course your frontend-templates must make use of this configuration!


contentCategoryFilterFields(...)

Returns the optionally configured "filter-fields" for a category.

  /**
   * Return the filter field list for a CDB-category.
   *
   * @param string $contentType Defines from which content-type (ct_label) the fields shall be returned.
   *
   * @param string $nodeCode The category's node_code
   *
   * @param string $nodeId The category's node_id. As an alternative (faster?!) to using "nodeCode".
   *
   * @return array|null Returns a numerical array of objects
   * [<n>]
   *   [field] - string Field label 
   *   [name] - string Translated field name (for use with (Backend) enduser)
   *   [type] - string Field type
   */

public function contentCategoryFilterFields(string $contentType, ?string $nodeCode, string $nodeId = null): ?array


Example, result

Array (
    [0] => Array (
            [field] => brand
            [type] => TEXT
            [name] => Brand
        )
    [1] => Array (
            [field] => prdv_color
            [type] => TEXT
            [name] => Varianten- Farbe
        )
    [2] => Array (
            [field] => prdv_size
            [type] => TEXT
            [name] => Varianten-Größe
        )
    [3] => Array (
            [field] => prdv_other
            [type] => TEXT
            [name] => Varianten-Ausführung
        )
)


Frontend: MDA-Fields (Most-Differentiating-Attributes)

In each category you can define optionally the record-fields which would make the biggest-difference of values to the frontend-user.

Of course your frontend-templates must make use of this configuration!


contentCategoryMDAFields(...)

Returns the optionally configured Most-Differential-Attribute-fields (MDAs) for a CDB-category.

/**
 * Returns the configured Most-Differential-Attribute-fields (MDAs) for a CDB-category.
 *
 * @param string $nodeCode The category's node_code
 *
 * @param string $nodeId The category's node_id. As an alternative (faster?!) to using "nodeCode".
 *
 * @param array|null $dataCategory
 *
 * @return array|null Returns a numerical array of objects
 * [<n>]
 *   [field] - string Field label
 */

function contentCategoryMDAFields(?string $nodeCode, string $nodeId = null, ?array $dataCategory=null): ?array

Example, result

Array (
    [0] => Array (
            [field] => "prodv_size"
        )
    [1] => Array(
            [field] => "weight"
        )
)