Nesting Tags List in an Asset listing


#1

**VM version - 5.4.5.1 **

Hi,

New to squiz and building a demo / evaluation using the VM. I have a few article pages (standard pages) tagged and I have the tags listed on the page using a nested tags listing page with the replacement root node set to the current asset. that works fine.

I wanted to build a sectional landing page but cannot get the tags to appear as part of an asset listing. I’ve tried two methods.

So assuming the asset listing is 12345 and the tags listing is 54321.

  1. Create a tags listing that uses a get variable to replace the root node. this works fine if you just view it directly. ie

https://demo.site/_nocache?a=54321&root=22222&SQ_ASSET_CONTENTS_RAW

(22222 is the standard page being listed) it prints out the tags associated with the page. If I include it in the default format of the main asset listing with a static value:

%globals_asset_contents_raw:54321^with_get:root=22222%

That works also. But the moment I try to use a dynamic keyword

%globals_asset_contents_raw:54321^with_get:root={asset_assetid}%

It prints out the tags for ALL the standard pages in the list for each of list items (including creating duplicates if more that one page tagged with the same tag).

  1. So the second approach.

With reference to this page: https://matrix.squiz.net/manuals/asset-listing/chapters/list-current-asset-id

I delete the get based root node replacement and use the session variable list_current_asset_id (and If dynamic root not found set to return empty). When this is now both viewed directly or via the default format:

%globals_asset_contents_raw:54321

it returns ‘No results found’

I am at the end of knowing what to try next. It appears to me that BOTH approaches should work but neither does.

Does anyone have any ideas?

thanks in advance


(Bart Banda) #2

That’s because global keywords are processed last, at the top level, not when each type format is processed for listing an asset in an asset listing, so in that case the {asset_assetid} relates to the top level %globals_asset%.

2 other ways you could try:

Nest in the 2nd asset listing and use the https://matrix.squiz.net/manuals/asset-listing/chapters/list-current-asset-id method.

Or use SSJS and do something like this: Problems with keyword replacement values as modifiers


#3

thanks - used the SSJS option. To complete the thread:

<script runat="server">
 print('%' + 'globals_asset_contents_raw:1073^with_get:root='+ %asset_assetid% +'%');
</script>