This one is fairly interesting, I’m not entirely certain what’s going on but:
with_get definitely works with
You can set up a simple example where you include an Asset Listing via a keyword and supply a get param then use that param inside the Asset Listing with
%nested_get and see that it works.
Host page =
Listing (#792) =
- You can supply the sort parameters when using a Nest Content Container
If you pass the
page_asset_listing_792_sort_direction values in to a Nest Content Container the old fashion way, the sorting works.
- For some reason, those parameters do not work via
When you try both at the same time, the sorting doesn’t work (as you observed). The parameters are definitely getting through, because you can check them with
%nested_get_page_asset_listing_792_sort_by%, but the sorting just doesn’t happen.
So we know we can pass values from keyword to a Nest Container, and from a Nest Container to an Asset Listing, let’s do something terrible.
- Create your listing with the asset sorting settings (#792)
- Create a shim page with a Nested Content Container (#813)
- Nest the listing in the shim page and set up two parameters to pass the sort_by and sort_direction through
- Lastly, use your globals keyword to bring the shim page into the SSJS in your actual page
var source = "%globals_asset_contents_raw:813^with_get:page_asset_listing_792_sort_direction=0&page_asset_listing_792_sort_by=3^json_encode%";
var source2 = "%globals_asset_contents_raw:813^with_get:page_asset_listing_792_sort_direction=1&page_asset_listing_792_sort_by=1^json_encode%";
This snippet includes the same listing twice with different sort settings.
- You probably want to exempt both your Shim and your Listing from caching in Cache Manager, lest you ruin your day. Assuming the pages are never accessed directly this shouldn’t have any adverse effects.