How to pass in dynamic variables to an asset listing to set start asset/position


(Kequi) #1

Hi,

 

Having difficulty getting anything reasonable for this so any help would be appreciated.

 

I have a page which is new linked into several different "top 20" type lists.

When I show this page - I also want to show it's position in all of the top 20 lists.

But I just want to show this page - and the 2 results before this page - and the 2 results after.

 

So, if this page was number 13 in list A - I would be able to list just the results from this list:

 

11

12

13

14

15

 

 

Now I know I can hard set an asset start position in an asset listing - so I could create separate asset listings for each top 20 list type for each page.

But I'm going to end up with a lot of asset listings to manage this way - 300 to 400 assets.

 

I'm used to nesting funnelback pages - and being able to pass in variables like num_ranks - or passing in global metadata values.

 

Ideally I would be wanting to set the rankings as metadata - then pass this through to the an asset listing nested on a paint layout.

So I only have 10 asset listing pages and I pass through the start position when nesting the asset.

 

Any clever ideas anyone?

 

Much appreciated

 

Karl

 

 

Oh - and I can't figure out how to do it using replacement root nodes, looking up the tree down the tree etc etc either.

Either way, there is no way to dynamically tell matrix which asset to start the listing at.


(Nic Hubbard) #2

It doesn't look like you can use a keyword for the start position field, so that isn't going to be helpful at all.


(Kequi) #3

Oh well...

 

I kind of thought that might be the answer.

 

Would be a nice feature to have.

 

I figure I will just build all the Asset Listings and use a single format for the results so when I do have to modify - there will be just one format to work on.

 

Thanks Nic,

 

Karl


(Anthony) #4

Could you just list them all but tag each one with an ID including its position number and then have a bit of jQuery to show / hide the ones you want / dont want? If you pass in a querystring including the number of the "root" you want then you can output that as a parameter to a javascript function that then does the maths and calls the show/hides.

 

That would be my preferred option, but I wonder if there is also any way to do it setting the asset listing to paginate and reverse engineering the parameters squiz uses to control moving from one "page" to another? I know I do something a bit like that with a calendar asset - hide their next/previous month but pass in the dates i want using the same parameters squiz would have used.