Skip to content

Conversation

russss
Copy link
Contributor

@russss russss commented Apr 29, 2019

This allows the row to be identified on row pages. The context here is that I want to access the row's data to plot it on a map.

I considered passing the entire template context through to the hook function. This would expose the actual row data and potentially avoid a further fetch request in JS, but it does make the plugin API a lot more leaky.

(At any rate, using the selected row data is tricky in my case because of Spatialite's infuriating custom binary representation...)

This allows the row to be identified on row pages.
@russss
Copy link
Contributor Author

russss commented Apr 29, 2019

Actually I think this is not the whole story because of the rowid issue. I'm going to think about this one a bit more.

@russss russss changed the title Add primary key to the extra_body_script hook arguments [WIPAdd primary key to the extra_body_script hook arguments Apr 29, 2019
@russss russss changed the title [WIPAdd primary key to the extra_body_script hook arguments [WIP] Add primary key to the extra_body_script hook arguments Apr 29, 2019
@russss
Copy link
Contributor Author

russss commented Apr 30, 2019

I think the best approach to this is to pass through the view_name parameter I added in #441. It's then simple enough for me to add .geojson to the URL in JS - I don't need the pkey.

@russss russss closed this May 1, 2019
@russss russss deleted the primary-key-in-extra-script branch May 1, 2019 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant