By: Olifants
Date: 2007-05-18
Time: 21:04
|
Any experiences with blocks and conditional sections?Since my testing with templates I found a site with a nice little menue on it which I want to modify to fit tbs as a workout.
You can see the menue at http://www.htmldog.com/articles/suckerfish/example/ But for my regretfulness I'm not able to do this. Here is a piece of the modified code with which I tried my luck. In the menue there are for example 2 words, than a picture and after that 3 words again. For the menue I created an array:
I would be glad, if there is somebody who is very familiar with - or don't I need that for my code? |
||
By: TomH
Date: 2007-05-18
Time: 21:13
|
Re: Any experiences with blocks and conditional sections?Please tell what happens when you run the code...
and how it is different from what you expect. |
||
By: Olifants
Date: 2007-05-18
Time: 21:25
|
Re: Any experiences with blocks and conditional sections?First thanks for your quick reply!
And here is what I see in the html output. As you can see in the menue there is the array entry 0, 1 correct, after that he takes the entry 2 as a href too, then he takes the entry 4 and at last the img src is empty.
I guess my block coding is totally wrong and unusable. |
||
By: TomH
Date: 2007-05-18
Time: 22:02
|
Re: Any experiences with blocks and conditional sections?I'm not sure if I understand exactly why you are doing it that way...
If I were trying to do something like that I'd use an 'ondata' function something like...
The above is psuedo code - UNtested - and is only intended to give you my approach See also the TBS examples http://www.tinybutstrong.com/examples.php select the "Event Functions" example Hope that helps, TomH |
||
By: TomH
Date: 2007-05-19
Time: 01:04
|
Re: Any experiences with blocks and conditional sections?Ooops the function should be more like this...
That IS tested and works! TomH |
||
By: Olifants
Date: 2007-05-19
Time: 01:40
|
Re: Any experiences with blocks and conditional sections?Thanks a lot that was a nice shot. (Only the last pointKey must be a pointVal for printing the image.)
My aim in the first coding was to clear the html from every php respectively to put every html code in the html file. The function is fine and I think it's a good solution. Do you think it's ok with regard to the seperated jobs of the designer and the programmer, the separation of the design and the programming? |
||
By: TomH
Date: 2007-05-19
Time: 02:29
|
Re: Any experiences with blocks and conditional sections?Maybe your first approach might work - but I couldn't find the answer - maybe others on this forum will see all this and be able to help better.
For separation of code and layout -- it is never perfect -- there is always a compromise. But TBS will take you so much closer to a good separation than anything I have seen yet. Best of luck, TomH |
||
By: Olifants
Date: 2007-05-19
Time: 09:29
|
Re: Any experiences with blocks and conditional sections?Thanks really a lot.
I'm a rookie in TBS and I'm happy that there are people like you which are already so much closer to things like that and are willing to help with fun and advice. I've spent a little time with vLIB - good template-, then I looked for TBS and considered it might be the better choice. So I'll go for it. Nice day and good ideas Ronny |