Adapting Our Management Page To Be Multi-Tool
Last week, we adapted our public facing index.bxm page to dynamically include whatever file we passed to it. This way we could display the carousel page when needed and the articles page when needed. We need to do the same thing to our management bookstore/management/index.bxm page.
Here are the steps you need to follow. Use bookstore/public/index.bxm as a model.
Create a <bx:param /> for the variable "t" at the top of the page. Default that to
manageArticles
.Change the <bx:include /> which now includes manageArticles to include the file "#t#.bxm.
In bookstore/management/horizontalNav.bxm
Change one of the <li> in the nav to have the text "Manage Articles". Change the href property of the <a> to open "#cgi.script_name#?t=manageArticles".
Add another item in the navbar to read "Manage Books" and open "#cgi.script_name#?t=addEdit".
You will need to create a page called addEdit.bxm in the bookstore/management/ folder. For now just put some dummy text in it.
Make sure your site is started and open the bookstore management page. Can you use the navigation bar to switch between the Manage Articles page and Manage Books?
Last updated