Posted 13 May 2010 - 03:38 AM
I've been given the task of refactoring the code-base powering the admin interface of one of our web applications and I'm just after some pointers. The application was written in a bit of a hurry and some of the page-display code has ended up in unexpected places, and it is my job to put this right.
The problem is the main menu. There is a main menu at the top of each page (Home, To Do, Products, News, and Manufacturers). I am writing the "Manufacturer" section, and I added the manufacturer entry to the menu bar in file "<app-root>\themes\classic\views\layouts\main.php" (using the Main Menu widget). The problem is that on some of the sections ("Home" and "To Do"), my new entry is not appearing. The guy who gave me the job mentioned that he "copied and pasted" some code, so I guess these pages are drawing their menu-generation code from more model-specific template areas.
My question is where might he have put such code? Where might Yii be calling it from? I'm sorry that I do not know more about Yii to give more details...
Posted 13 May 2010 - 05:03 AM
There can be more layouts, you can check in the controllers if the are using different layout, or the menu can simply be replicated in all views.
If is replicated, the best idea is to put in the layout andd to delete from all pages in wich the menu' has been copied.
Posted 14 May 2010 - 06:15 AM
According to Yii convention, should the theme directory files be modified, or should I force each controller to look for view files under the protected directory?
EDIT: One more thing: There are two main layouts, one-column and two-column. At the moment they call two different generic page templates, "main.php" and "one-column.php". Is there an easy way of just getting them to call one generic template and specifying the columns elsewhere?