---
title: "Example - manual relation sorting"
slug: "example---manual-relation-sorting"
abstract: "An example of how to apply manual sorting to a Search component."
---
# Example - manual relation sorting

The **Manual relation sorting** feature lets you give users the ability to create a search, the results of which they can manually sort. Each time they sort the results, the order is saved for the next time they use that search.

> [!warning]
> Use the **Manual relation sort** feature carefully because enabling it puts a significant load on the server. For this reason, we do not recommend using this feature with large samples. Keep the number of nested relations on an entity definition below three and the number of relations below 50. Be sure to review [relation best practices](https://doc.sitecore.com/ch/en/users/content-hub/performance.html) to ensure optimal performance.
>
> Only enable this feature if you have permission to view all items in the search results. Otherwise, the items you can't see will be removed from the relation.

The following image shows an example where **Manual relation sort** was added to the product details page. The assets associated with the product can now be reordered using the icons.

![Example of manual sorting](https://doc.sitecore.com/api/markdown-image/ch/en/users/content-hub/images/example_of_manual_sorting.png)

> [!note]
> **Before you begin**
> -   Add a [**Search** component](https://doc.sitecore.com/ch/en/users/content-hub/search.html "Search") with a fixed filter to the product details page.
>
> -   Turn on **Allow navigation** in the [schema](https://doc.sitecore.com/ch/en/users/content-hub/data-model.html "Data model") for the *PCMProductToAsset* relation used. This requires administrator permissions.

Turning on manual relation sorting will disable automatic [sorting](https://doc.sitecore.com/ch/en/users/content-hub/sorting-tab.html "Sorting tab") and [paging](https://doc.sitecore.com/ch/en/users/content-hub/paging-tab.html "Paging tab") for the **Search** component. The feature is only usable in list and table views, and it can't be used if the **Search** component has a [fixed filter](https://doc.sitecore.com/ch/en/users/content-hub/filters.html "Filters") containing a wildcard.

## Add manual sorting

In this example, you modify the **AssetSearch** component that is part of the product details page.

To add manual sorting:

1. On the menu bar, click **Manage** :mdiCogOutline:.
2. On the **Manage** page, click **Pages**.
3. On the **Pages** page, in the left pane, click **Product details**.
4. In the **MAIN ZONE**, click the **Tabs** component to open its details page.
5. In the left pane, click **Assets**.
6. Click the **AssetSearch** component to open its details page.
7. In the **Filters** section, ensure the following filters are defined.

    :::tab{title="System"}

    - Filter type - *Definition*
    - Definition - *Asset (M.Asset)*

    :::
    :::tab{title="Fixed"}

    - Input type - *Page entity*
    - Filter type - *Relation*
    - Filter - *Assets (PCMProductToAsset)*
    - Role - *Parent*

    :::

8. In the **Functionality** section, turn on the **Manual relation sort** switch. For the purpose of this example, ensure all other switches are turned off.
9. On the left pane, in the **Views** section, turn on the **List** switch. For the purpose of this example, ensure all other switches are turned off.
10. In the **Template** section, click the default list template.
11. On the **Operations** tab, click **Add operation** > **View detail page**.
12. In the **View detail page** section, click :mdiPlus: **Add**, select **Product details** and then click **Save**.
13. In the **Rendition** drop-down list, click **Thumbnail**, and then click **Save**.
14. In the **Fields** section, click :mdiPlus: **Add field** and define the following property fields.
    - Type - *Property*
    - Field - *Title (Title)*
    - Display format - *Text*
    - Style - *Regular*
    - Limit number of lines - *off*
    - Show help text - *Inline*
15. Click **Save and close**.

## Use manual sorting

To use manual sorting:

1. In Content Hub, go to the page where you have enabled manual sorting (in this example, the **Products** page).
2. Click a product to open its details page.
3. On the **Assets** tab, add assets.
4. To move an asset, click the :mdiDragVertical: icon and drag the asset to a new location.

The new order is saved automatically.