and thanks for this Framework7 community !
I’m trying to create an app based on Framework7 that would let you use different themes, placed in different folders, like
/www/themes/project1
/www/themes/project2
…
I would like to automatically add routes to my main view in this fashion :
(I understand that if I simply put a link to /themes/projectName/index.html it won’t work automatically)
So is that even possible to add routes to my existing main view, so that in my virtual list of projects I can click on a simple link like
that’s actually what I tried in the first place, pushing the routes to the array, but it doesn’t work.
If I console.log the app’s routes I’ve automatically created, and I juste copy and paste them in routes.js, they do work without any problem. For instance I take :
generated by my code, if I put it in routes.js it works, otherwise not.
So the routes are right, they are pushed in the right place (I can see the other working routes defined in routes.js), but maybe I have to “reinitialise” the router or do some other action on the app object ?
Hi, pushing routes after View init does not seem to work, while if I add them BEFORE view init it works. I would like to be able to push them after but as of now I solved the problem by adding them before.
a) pushing new routes to app.routes
b) mainView.destroy();
c) mainView = app.views.create(’.view-main’);
Pushing routes to mainView.routes causes some issues afterwards (e.g. multiple page transitions: pages seems to be dublicated, header is mixed up in case the old pages are not deleted).