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.
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.
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.
-
Add a Search component with a fixed filter to the product details page.
-
Turn on Allow navigation in the schema for the PCMProductToAsset relation used. This requires administrator permissions.
Turning on manual relation sorting will disable automatic sorting and paging 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 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:
-
On the menu bar, click Manage .
-
On the Manage page, click Pages.
-
On the Pages page, in the left pane, click Product details.
-
In the MAIN ZONE, click the Tabs component to open its details page.
-
In the left pane, click Assets.
-
Click the AssetSearch component to open its details page.
-
On the Filters tab, ensure the following filters are defined.
-
On the Functionality tab, turn on the Manual relation sort switch. For the purpose of this example, ensure all other switches are turned off.
-
On the Output tab, turn on the List switch. For the purpose of this example, ensure all other switches are turned off.
-
In the Template section, click the default list template.
-
In the Main click area section, click Add operation and then click View detail page.
-
In the View detail page dialog, click Add, select the check box next to Product details and then click OK.
-
In the Rendition drop-down list, click Thumbnail, and then click Save.
-
In the Fields section, click 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
-
-
Click Save and close.
Use manual sorting
To use manual sorting:
-
In Content Hub, go to the page where you have enabled manual sorting (in this example, the Products page).
-
Click a product to open its details page.
-
On the Assets tab, add assets.
-
To move an asset, click the icon and drag the asset to a new location.
The new order is saved automatically.