Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

So in the javascript app, we have a lot of repeated chunk of menu items with the specific settings: URL, Name, Title, etc etc (these settings sometimes can be optional). Here is the gist of the menuItem and we have tons of them.

The client pushes new changes every month or twice per month on these items, either the menu item should be named differently or the url is outdated or whatever.

Instead of going and changing each URL everytime, I thought about:

  • Creating a web-service, with a complete CRUD on menuitems, whatever comes in there, goes dirrectly via JSON, to the app

Well, I would like to hear if you have some thoughts on this idea of configuring the application rather than hardcoding the app each time when the CR comes.

Here is the gist of the menuItem and we have tons of them.

All help will be appreciated

share|improve this question

2 Answers 2

why not create some xml file which contains the structure of the menu items, including against each item the caption, url etc.?

Write some js to load and parse this file?

All you'd have to do then is update the xml file as and when the client changes things.

share|improve this answer

i will concur -- making an app to handle changing navigation menus on a website is so much more difficult then it sounds! i am dealing with having to do complicated inventory lookups - to determine if a product category - should be in the nav menu. i was semi-obsessed with trying to write it to a file because obviously do not want to go through all the inventory for every single page view just to show a nav bar.

anyway i could ramble on but - make a database table to hold the nav structure. have a script that runs once a day or whatever you need to update the navigation table. having it in a db immediately opens up easy ways to add and maintain. and you aren't doing a complicated search on the database every time you want to show the nav bar. and with cacheing you could even minimize the db strain.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.