Open sabinem opened 4 years ago
@sabinem
About routing customization - it depends. You can see the order in which controllers are declared in main index.js
, the /dataset
is declared here https://github.com/datopian/frontend-v2/blob/master/index.js#L110-L112 - after the theme, so this this endpoint should be easily overridable by your theme code. Plugins however are loaded before the theme, so they will take precedence.
Here is an overview of the request flow - http://tech.datopian.com/frontend/#design-how-it-works
Although probably you might even not need the custom routing - only custom html - you can just create a new view in your theme - it will override the default.
i18n files are pretty static already. They are indeed updated when meeting a new translatable string, but once all of new strings are filled in to the JSON files, they won't be updated. Currently i18n library is used to handle the translations.
@EvgeniiaVak
Thanks so much for getting back to me on this.
I get your point on the internationalization. I think we can live with that.
The routes are a different topic: All of our routes are custom for historical reasons: we just need to rebuild an existing application and preserve all urls. What would help me most in this regard, would be a configuration option in the .env to disable all standard routes:
index,js
and it had the desired effect: //app.use([
// dmsRoutes()
//])
What do you think about such a configuration option? Would that work for you? Can I help in any way to make this possible (by providing a PR for example)?
@sabinem Making the app more configurable sounds ok to me, as long as the old behavior is not changed.
@anuveyatsu @starsinmypockets What do you think? Would it be ok to have configuration option disabling DMS routes? Maybe we could also make plugin routes optional too?
@sabinem @EvgeniiaVak I'm not sure if disabling all core routes would be helpful. In that case why not to build an Express app from scratch as I think there will be very little benefit of using this library?
Re plugins, the controllers are only enabled when you add a plugin into your config file afaik.
We are currently developing a theme for this frontend.
What we struggle with is the following:
Certain routes that we need to implement,
/dataset
for example, are currently redirected by the router. How can we customize the routing?How can we customize the configuration of i18n? We would like to have it served from static files rather then from self updating ones.
These are questions on customization of this repo. Hope it is appropriate to ask them here.