Nesting asset list via keywords with session variable: list_current_asset_id


#1

I’m using an asset listing to count remote child assets which uses the session variable: list_current_asset_id.

This suits my purposes well when nesting via a traditional ‘Nest Content’ container type within the asset’s contents where needed.

My question is - how would I nest this assist listing via the %globals_asset_contents:xx% keyword with the session var intact? There are some instances where I need to include this listing amongst code blocks where additional containers make it a bit clunky.

Cheers for any help or guidance.


(Bart Banda) #2

So %globals_asset_contents:xx% is basically your asset listing and you want to pass a dynamic root node to it?

Something like %globals_asset_contents_raw:xxx^with_get:root=1234% ?


#3

Thanks Bart, That’s pretty much it but my goal is to have the get value to be dynamic.

My example is using this counter within a news carousel (asset listing) which displays the number of comments below an article listed in the carousel.


(Bart Banda) #4

Is the dynamic root node value going to be sourced from the frontend asset you are viewing on the frontend?

If so, you should be able to just use %globals_asset_contents_raw:xxx% and on the dynamic parameters of the asset listing use Set Value and %frontend_asset_assetid% as the root node value. Or change assetid to metadata if it’s coming from there.

Does that work?


#5

No not really. I’m trying to utilise asset IDs printed within an asset listing as the root nodes. My counter sits within the default format of this listing.

I gave the above a shot anyways (via global keywords + nesting), but as expected no dice.


(Bart Banda) #6

Have you tried using SSJS?

Using something like:

<script runat="server">
print('%'+ 'globals_asset_contents_raw:1234^with_get:assetsToList=' + '%whatever_keyword_you_want%' + '%');
</script>

#7

Thank you Bart! SSJS works like a charm :thumbsup: