Skip to content
This repository has been archived by the owner on Apr 9, 2020. It is now read-only.

Improve WP API #28

Open
gmh04 opened this issue Jan 18, 2017 · 6 comments
Open

Improve WP API #28

gmh04 opened this issue Jan 18, 2017 · 6 comments
Assignees
Labels

Comments

@gmh04
Copy link
Contributor

gmh04 commented Jan 18, 2017

Currently some on the metadata of the WP API that the app requires needs to mined for on the content.rendered field on the API. This is error prone and potentially expensive on the js thread (esp. as the react-native-html-parser is failing on this HTML snippet). It would be helpful if the following field were added to the API:

images: [
    http://curiousedinburgh.org/wp-content/uploads/img1,png,
    http://curiousedinburgh.org/wp-content/uploads/img2,png,
    ...
]

The order of images is significant, as the first one will appear in the Tour Summary page.

The tour_stop number is in the form history_of_physics_tour_stop, history_of_science_tour_stop and history_of_geology_tour_stop. It would be better if this was simply tour_stop

@NicolaOsborne
Copy link

@gmh04, apologies for delay in responding. The tour stops might repeat between different tours. So one reason the stops have a tour label is to avoid a stop appearing as, for instance, "stop 5" on multiple tours. There are some stops that appear in more than one tour by design so either we'd need to create a copy or use that tour+stop type label. I'm happy with either solution as long as it is clear to the academic contributors how to discern tour and tour stop to avoid any potential unintended changes etc.

The images in the app also include the videos associated with tours. I think we can certainly add new fields for images in the form suggested but it would be useful to know how to (a) include videos in this most sensibly and (b) manage variance in the number of images (some have 2, some have more like 6).

If you can provide any clarification on best approach to the above I'll get the appropriate fields set up accordingly in the WP API.

@NicolaOsborne
Copy link

Tour stop issue is resolved. The tour stops are now entered into a custom field callled tour_stops which uses the tour "slug", the tour stop number number and the pipe, e.g: history_of_geology:1|history_of_physics:3 for all of the tours that the stop appears on. (To find the "slug" the user browses the categories list).

This custom field has now been set up for all tour stops that exist in Curious Edinburgh as published posts.

At present the previous fields (History of Science Tour Stop; History of Geology Tour Stop; History of Physics Tour Stop; etc.) are still in place. They can be removed once the new iOS app is released (March/April). They are required for now because they power the currently on release iOS app.

@NicolaOsborne
Copy link

A new custom field for images is still to be added. This will take images in the form of: image1.png|image2.png|image3.png etc. The first image in the field will be the featured/key image for display in the app.

@jollopre
Copy link
Contributor

jollopre commented Feb 2, 2017

@NicolaOsborne, please can you check equivalences for:

  • Birthplace of James Clerk Maxwell: "history_of_physics_tour_stop": "3", however the attribute "tour_stops": "history_of_science:24".
  • Peter Higgs plaque: "history_of_physics_tour_stop": "9", however the attribute "tour_stops": "history_of_science:6".

As these posts do not match the slug history_of_physics the interface draws markers with blank tour stop.

@NicolaOsborne
Copy link

Changed.

@NicolaOsborne
Copy link

Changes made to Categories and custom fields for categories. You should now be able to access tour_status; tour_description; tour_icon in WP API

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants