Asset metadata passed as Nested content variable

Hi


I have an asset list which lists standard pages from a folder. These standard pages have metadata applied to them with a unique code on each. The type format for the asset list nests a REST Resource Javascript asset which requires the above metadata code to retrieve a specific XML feed.



So my thinking is that, in the nested content div where I nest the javascript asset, I should be able to pass through a variable called 'sedol' with the value of %asset_metadata_Sedol% ('Sedol' being the metadata field) and then the REST asset can use %globals_get_sedol% in the URL field.



However this doesn't work. The idea is sound as, if I pass an actual sedol rather than the keyword, it will retrieve the data no problem (but only for one sedol, not all the ones in the list).



So the question is how do I pass this variable from the metadata, via the asset listing, into the REST Resource Javascript asset?



Any help is much appreciated - we've had this issue in various guises for a while. We're running Matrix 3.18.9.



Thanks

Not sure if understand what exactly you trying to achieve. But I hope i can help.


So you want to pass sedol from all assets at once, right?



What if you have first part of script in one raw content block

[quote]

<!-- SRIPT —

bla, bla, bla

var="

[quote]

Than you have another nested raw asset listing showing only sedol from all assets in format you need to pass.

[/quote]

"

bla, bla, bla

— REST OF THE SCRIPT -->

[/quote]



And rest of the script again in raw block.



Hope this helps.

Thanks - I'm not quite sure whether that would work as the sedol gets pulled into the URL field we have on the REST Resource JS asset - which is an input box separate to the Javascript code itself.


To try and be more clear, this is what I have:



Standard page 1 - metadata of Sedol 1

Standard page 2 - metadata of Sedol 2

etc…



V



Asset listing lists the above pages



V



Asset listing standard page format nests a single REST JS asset and passes through the metadata sedol to it from each page in turn



V



The Javascript file calls an XML file using that sedol (in the URL field of the asset)

The Javascript file then processes the XML and returns the results to the page, specific for each standard page above.





I'm not sure if that's any clearer…

[quote]
Thanks - I'm not quite sure whether that would work as the sedol gets pulled into the URL field we have on the REST Resource JS asset - which is an input box separate to the Javascript code itself.



To try and be more clear, this is what I have:



Standard page 1 - metadata of Sedol 1

Standard page 2 - metadata of Sedol 2

etc…



V



Asset listing lists the above pages



V



Asset listing standard page format nests a single REST JS asset and passes through the metadata sedol to it from each page in turn



V



The Javascript file calls an XML file using that sedol (in the URL field of the asset)

The Javascript file then processes the XML and returns the results to the page, specific for each standard page above.





I'm not sure if that's any clearer…

[/quote]



Are you able to send me or post here your REST JS script.

Well the javascript itself isn't really related - the issue is with the following servicelayer call that is not returning the XML because it can't get the sedol:


http://servicelayer/rest/Fund/ff_fund_search/sedol/%globals_get_Sedol%/format/rawxml



If I was to replace the %globals_get_Sedol% with a hard-coded sedol that I already know, it works fine, returns the XML and the Javascript processes it.



The problem is that it needs to return the sedol for each item in the asset list.

[quote]
Well the javascript itself isn't really related - the issue is with the following servicelayer call that is not returning the XML because it can't get the sedol:



http://servicelayer/rest/Fund/ff_fund_search/sedol/%globals_get_Sedol%/format/rawxml



If I was to replace the %globals_get_Sedol% with a hard-coded sedol that I already know, it works fine, returns the XML and the Javascript processes it.



The problem is that it needs to return the sedol for each item in the asset list.

[/quote]



Yes it turns out to not be possible to do that right now, because of the keyword scope! We have a fix in testing at the moment to allow access to current asset in listing keywords.