1

When you're on the asset listing page and select a facet, like asset type, the URL gets appended with some encoded format, for example: https://ContenthubInstance/en-us/Assets?q9815=GQAAAB-LCAAAAAAAAAMzOLz90Gqjw9sNTQwOb7c4vN3E2MjA9NDuw9MBbBs2oBkAAAA1. However, I'd prefer it to remain unencoded, like this: https://ContenthubInstance/en-us/Assets?Assettype=A.

The request is to ensure the Content Hub asset listing page URL is more user-friendly when opened in an external system (not sitecore) via an Iframe with predefined filters.

For instance, when I'm on Page A in the external system and open Content Hub, it should have asset type A selected. Similarly, when I'm on Page B, it should have asset type B selected. Right now, our external system does not recognize this encoding, so it is not possible to open Content Hub with predefined filters.

Or can we at least determine the type of encoding that Content Hub uses? This way, we can decode it and develop our logic accordingly.

1 Answer 1

1

You can calculate the encoded value passed in the facet filter using the Content Hub Search Api. Inside the Search Api, you need to use Query Builder to construct the request payload as below.

Request Url: {ContentHub_InstanceUrl}/api/search

Request Method : POST

Request payload :

{
    "filters": [
        {
            "name": "taxonomy_items.98.children",
            "operator": "FacetEquals",
            "values": [
                163658
            ]
        }
    ]
}

In the above payload, name is the value of the AssetType taxonomy item i.e. 'taxonomy_items.98.children' and value is the entity id of the filter value.

When you run the above query, it gives you the encoded value in the query output as below, which can then be used to return the filtered result as desired.

enter image description here

Using the above query value, you can open Content Hub with predefined filters, from an external system.

More details for the Query Builder can be found below.

https://doc.sitecore.com/ch/en/developers/cloud-dev/functionality.html#available-operators

Hope this helps!!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.