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.
- If the administrator dashboard isn’t displayed, click Manage to display it.
- Click .
- Click + Add field.
- In
Add a new field
, select Number (Integer). Enter Weighting as the label title. - Click Save and continue.
- Leave the
Allowed number of values
set to 1 and click Save field settings. - Enter 0 as the default value, click Save settings.
- Click Save.
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
- If the administrator dashboard isn’t displayed, click Manage to display it.
- Click Content, and select
Product
from theContent type
, 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, click Save. - For Product2 click edit, in the
Weighting field
, select 3 as the value, click Save. - For Product3 click edit, in the
Weighting field
, select 1 as the value, 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.