Asset list of numbered siblings - not including current asset


(Rob Gilbert) #1

Hi there!

 

I have created a nested asset listing which displays all the siblings of the current page in a mini nav at the top of page. I would like to number these in the order they are in the asset tree and have found I can do this easily enough with a %asset_position% tag in the right place.

 

So far so good.

 

I would like to exclude the current asset from the list so it doesn't show in the nav. I can do this on the asset list details screen by updating the 'exclude current asset' setting. 

 

This however has the side effect of changing the number of assets in the list and the numbering of the assets shifts to reflect this.

 

My pages essentially need to retain their order and the their position in the asset tree - not the updated order in the asset list - whilst simultaneously not showing the current page in the list.

 

I am on the verge using of some client side JS to do it. Can anyone help?


(Peter McLeod) #2

Hi

Something along these lines in the type format might work:

%asset_assetid^replace_keywords:eq:{globals_asset_assetid}::{asset_position}. {asset_name}% 

Thanks

Peter


(Bart Banda) #3

Yea, you would need to allow the current asset to be listed still, but if it does get listed, use keyword modifiers to not print anything if it's the current asset. 


(Rob Gilbert) #4

Hi guys,

 

Thanks for getting back -

 

Bart - the keyword modifier thing crossed my mind but couldn't find a current asset modifier.


(Rob Gilbert) #5

Hi guys, got pack to that template today and your help worked a treat.

 

Many thanks