Kooz's IDLT (Instructional Design and Learning Technology) blog describes the journey of my thoughts as I get my MA in IDLT.

Thursday, October 07, 2010

When Design and the Back End Align

I had a big smile on my face when I realized that the search script is essentially the same as the manual script. The search string goes through each manual database and does a “Full Text” search (each word in a SQL query is indexed minus certain common words), and if there’s a match, then SQL returns the Category ID and ID in an ordered array (by descending relevancy). For each entry returned, it also sees if there’s any photos for that rule. It constructs the php file as such: for each entry, it concatenates (adds on to) two different variables. The first variable is a text string that will become the top level navigation for the search results which are the titles of the rules and a link to the rule. The second variable is the actual rule. After going through all the search entries, the php script essentially prints these two variables out (the top level navigation is an unordered list that has javascript/css applied to it). This was easier than I thought it would be.
The manual is created on the fly just like a search query. It creates one page, but via the iPhone, it looks like separate pages. However, there’s one more level of navigation that the search does not: for the search it goes rule title to rules (and possible pictures). In the manual, it goes chapter to rule title to rules (and possible pictures). The manual script loops through the manual chapters, then through individual rules, and sees if each rule has photos involved. To make three levels of navigation, I needed three variables and three loops to go through all of the entries. Since printing out the variables is essentially printing the html in three sections, the challenge was making sure the end tags were placed in the right spot so that I wouldn’t get formatting errors. The key was to count the number of entries in each chapter and assign that to a variable so that when it got to the last entry, it would add that end list tag. All you have to do is print out ("echo") the three variables, and you have your manual with a hierarchy of linked lists!

0 Comments:

Post a Comment

<< Home