sort_ by
string | sort_by: string
returns string
Generates a collection URL with the provided parameter appended.
This filter must be applied to the object property collection.url.
Accepts the following values:
manual(as defined in the collection settings)best-sellingtitle-ascendingtitle-descendingprice-ascendingprice-descendingcreated-ascendingcreated-descending
Tip: You can append the <code><span class="PreventFireFoxApplyingGapToWBR">sort<wbr/>_by</span></code> filter to the <a href="/docs/api/liquid/filters/url_for_type"><code><span class="PreventFireFoxApplyingGapToWBR">url<wbr/>_for<wbr/>_type</span></code></a> and <a href="/docs/api/liquid/filters/url_for_vendor"><code><span class="PreventFireFoxApplyingGapToWBR">url<wbr/>_for<wbr/>_vendor</span></code></a> filters.
{{ collection.url | sort_by: 'best-selling' }}
Code
{{ collection.url | sort_by: 'best-selling' }}Data
{
"collection": {
"url": "/collections/sale-potions"
}
}Output
/collections/sale-potions?sort_by=best-selling
Output
/collections/sale-potions?sort_by=best-sellingWas this page helpful?