Tutorial: Using a custom weighting sort order on the product list page
You can use a custom weighting to sort your products on the API products list page of your Developer Portal.
Before you begin
You must have a Developer Portal enabled, and you must have administrator access to complete this tutorial. The tutorial Creating the Portal explains how to enable the portal if you have not already done so.About this tutorial
In this task, you set up a weighting sort criteria and use it to list your products, on the API Products page, in a particular order. You set up the weightings so the order reads, Product3, Product1, and Product2.
For example, the API Products page below displays Product1, Product2, and Product3 in this order before the weightings are added.
Add a custom integer field to the API content type
- Log in to your Developer Portal as an administrator.
- Navigate to .
- Find
Product
and click Manage fields. - On the Manage fields page, click + Create a new field.
- From the Choose a type of field list, select Number, and click Continue.
- In the
Label
field, enter Weighting and select Number (integer). - Click Continue.
- Leave the
Allowed number of values
as 1. - Select the Set default value checkbox and enter 0 as the default value.
- Click Save settings.
The Weighting
field now shows in the Manage fields
list.
Modify the Products view to change the sort order
You modified the Products
view to sort based on Weighting
(field_weighting)
.
Add a weighting to each Product
- Click Content, and from the
Content type
list, selectProduct
. - Click Filter. A list of available Products on your site is displayed.
- For Product1, click Edit, in the
Weighting field
, select 2 as the value, and click Save. - For Product2 click Edit, in the
Weighting field
, select 3 as the value, and click Save. - For Product3 click Edit, in the
Weighting field
, select 1 as the value, and click Save.
The API Products page displays Product3, Product1, and Product2 in this order after the weightings are added.
What you did in this tutorial
You changed the order that the API Products appear on the products page.