By: Col
Date: 2009-02-08
Time: 05:45
|
Turn array into simple menu systemI'm trying to turn an array similar to this:
into this:
Each Menu Choice item will be a link to a script. By simply changing the array the menu will be updated. I have had a go at implementing this using sub-blocks, dynamic columns and groupings without success. If I need to change the format of the array above to make this work that's fine. If anybody has an ideas I'd love to hear them. Thanks. Col |
||
By: TomH
Date: 2009-02-08
Time: 07:39
|
Re: Turn array into simple menu systemHi Col,
Can't see what you're doing, post the php file and the html template that you're using for the menu. |
||
By: Col
Date: 2009-02-08
Time: 08:52
|
Re: Turn array into simple menu systemHi Tom,
From the php array above I'd like to form this html code:
How can I achieve this using TBS? Note that the format of the originating array is not set in stone; I am happy to change that. Also the above table is not set in stone either. I am happy to implement it another way as long as the general lay out is similar to outlined above. Hopefully that has shed more light on my understated original problem. If not just yell. :) Col |
||
By: TomH
Date: 2009-02-08
Time: 13:58
|
Re: Turn array into simple menu systemCol,
My apologies, when you mentioned that you 'had a go at implementing'... I assumed you had code that you tried yourself to create a solution, that's what I was referring to. If no, then to learn, you could read and test the examples at http://www.tinybutstrong.com/examples.php (note the box at the upper left) where you can see both the php and html source for learning how do do specific tasks. The best way to learn TBS is to learning how those examples work by applying them to data from your own situation, then you will be far ahead of most new to TBS. Sorry, I am too busy to write the code for you, but will be happy to help you debug it when you have some work to share. |
||
By: Col
Date: 2009-02-09
Time: 02:55
|
Re: Turn array into simple menu systemNo worries Tom. I actually wasn't looking for a hand out of solution code but rather a pointer. I was hoping that someone was going to tell me I wasn't fully understanding the way blocks or header groups or something else worked. I did have code from my own trial and error testing but it was a mishmash of reworked TBS code from the examples page.
Anyway I had decided to split my headings array (from original post) out into 3 separate arrays and place them each in a table which would be nested inside another table. Obviously not really the solution I was after as I couldn't just add a new heading to my heading array and have that change automatically reflected without changing the table within the html code. Through starting to do this though I actually arrived at the solution I was originally after. As is usually the way with TBS it is actually quite simple and I'm a little embarrassed that I didn't work it out while testing with the sub-block code. Anyway, for others searching this forum in future here is what I did. The heading array is as defined above. PHP code:
HTML code:
Hope that helps someone. |
||
By: Skrol29
Date: 2009-02-09
Time: 15:26
|
Re: Turn array into simple menu systemHi,
I would do it the same way. |