Passthrough of get variables with asset listings


(Joel Porgand) #1

So I'm probably trying to be too fancy here but here's my setup:

 

* I have some CSV datasource assets

* I have an asset listing for each CSV datasource

* The CSV datasources are setup to take a dynamic input GET variable

* I have another asset listing which lists the other asset listings and uses %asset_contents% to print the contents of each asset listing - mashing them all together

* The asset listing that collates the other asset listings is setup to take a dynamic parameter so I can do an asset selection.

 

What I was basically trying to achieve was to have a bunch of datasets that could be selected from, then have the items populating each filtered by keyword. End result being a kml file that I can overlay on a google map.

 

Unfortunately it looks like GET vars don't get passed through to the asset listings that are being rendered by the main asset listing with %asset_contents%, so the CSV datasources aren't getting filtered. If loaded up normally with a var in the url the csv asset listings filter as one would expect.

 

Anyway, I guess the point of this is is

1) Can anyone think of another way to do this? I'm thinking I might have to switch to just rendering the asset listings individually & overlaying them on the map one at a time if I want to use keyword filtering.

2) The explanation for %asset_contents% in the doco is a bit light on detail - the only useful information it gives is that any paint layouts applied to the asset will be used. Alternatively some doco surrounding what scenarios GET/POST/etc will/won't get passed through in would be cool.

 


(Nic Hubbard) #2

Not entirely sure I am following what you are wanting to do...


(Anthony) #3

Like Nic, I'm not 100% sure I follow... But... gut feeling is you hit the same snag I did recently where GET variables arent passed down properly when one thing is nested within another. In my case it was a calendar asset and the variables for date range etc. Searching this forum I found it was a known bug / limitation in the way GET variables were passed around the system, and it got addressed in about 4.10 ish. There was a patch which looked like only about 4 lines of code if you're brave enough to try that. See this thread: http://forums.squizsuite.net/index.php?showtopic=5424 - ignore the initial disucssion, the relevant bit for me was at the very end

 

On considering my options, I deiided to avoid Squiz nesting and use an ajax call (via JQuery().load()) to get my data dynamically, that way I could simply pass a query string witht he options I needed to the load(). Unfortunately it sounds like in your case that may not work because you probably dont want to be relying on client side JS to grab your data.

 

Back to your specifics... rather than individual asset listings can you use a search asset? If you set its root(s) so as to include all the data sources, does it give you more flexibility than an asset list to select only the items you want?


(Joel Porgand) #4

I really am pretty apalling at explaining things.

 

May as well just give you a link to the thing:

 

http://gjames.com/res/mapdata/feed

 

as far as document structure goes....

<kml>
    <Document>
        <name>feed</name>
        <description/>
        <Style id="wide-thumb"></Style>
        <Style id="high-thumb"></Style>
        <Style id="gossi-mark"></Style> <!-- styles and everything this line and above are in bodycontents of the the main asset listing, everything below is printed by listing my other asset listings and using %asset_contents% as the type format -->
        <Placemark id="Hamilton_Harbour"></Placemark> <!-- start of one asset listing -->
        <Placemark id="M_A"></Placemark>
        <Placemark id="A_333_Ann"></Placemark>
        <Placemark id="Translational_Research_Institute"></Placemark>
        <Placemark id="ABC_Headquarters"></Placemark>
        <Placemark id="Brisbane_convention_and_Exhibition_Centre"></Placemark>
        <Placemark id="Brisbane_Central"></Placemark>
        <Placemark id="Green_Square_North_Tower"></Placemark>
        <Placemark id="Aurora"></Placemark>
        <Placemark id="Riparian_Plaza"></Placemark>
        <Placemark id="Gasworks"></Placemark>
        <Placemark id="A_51_Alfred"></Placemark>
        <Placemark id="QIMR"></Placemark>
        <Placemark id="Capitol_Apartments"></Placemark>
        <Placemark id="Infiniti_Showroom"></Placemark>
        <Placemark id="Energex"></Placemark>
        <Placemark id="Icon_Place"></Placemark>
        <Placemark id="Synergy"></Placemark>
        <Placemark id="Sir_Samuel_Griffith_Centre"></Placemark>
        <Placemark id="Qld_Childrens_Hospital_QCH"></Placemark>
        <Placemark id="AFP"></Placemark>
        <Placemark id="Suncorp_Stadium"></Placemark>
        <Placemark id="Anthopology_Museum"></Placemark>
        <Placemark id="Findlay_St_Sports_Field"></Placemark> <!-- Start of another asset listing -->
        <Placemark id="Springwood_Park"></Placemark>
        <Placemark id="Oakman_Park"></Placemark>
        <Placemark id="John_Davidson_Park"></Placemark>
        <Placemark id="Mitchelton_Library"></Placemark>
        <Placemark id="Wellington_Pt_Reserve"></Placemark>
        <Placemark id="Rochedale_Estates"></Placemark>
        <Placemark id="Tygum_Park"></Placemark>
        <Placemark id="Colleges_Crossing"></Placemark>
        <Placemark id="Southpine_Sporting_Complex"></Placemark> <!-- End of the second -->
    </Document> <!-- that's the end of the list, so now we're back to the main asset listing bodycopy -->
</kml>

So the main asset listing is basically just a wrapper to put all of our datasets together & hold the style information for the different types of placemarks.

 

I'm using different asset listings as datasets don't necessarily contain the same information, though I guess that's not really a critical aspect. There's not really any harm in leaving irrelevant data fields empty, and if I bring it back to a single asset listing then I no longer have the issue with the passthrough of GET vars.

 

Anthony: it sounds like a similar issue, yes. No nesting going on here, but the assets rendered with %asset_contents% don't get passed GET vars by the main list.


(Nic Hubbard) #5

So, are you not able to just make each dataset a root node for the one asset listing and then just list everything?


(Joel Porgand) #6

So, are you not able to just make each dataset a root node for the one asset listing and then just list everything?

 

The datasets don't necessarily share common fields. That said I think I might end up just using a single listing & just leave empty tags in the kml where the datasets don't overlap.


(Anthony) #7

If you run it all through one listing, could you use modifiers like ^empty and ^notempty to exclude the elements when a particular metadata field is not present (or blank) for a particular asset?