Categories > TinyButStrong general >

Output formatting problem

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Youri
Date: 2007-05-04
Time: 12:01

Output formatting problem

Hello, recently I was working on multilevel menu template. After some experimenting I followed Skrol's idea from topic:


Problem is that in output code I get something like:

   <ul>
    <li><a href="1.htm">1</a>
    </li><li><a href="2.htm">2</a>    
    </li><li><a href="3.htm">3</a>    
    </li>     
   </ul>

Output is semantically correct, but ugly. Is there a way to put closing li tag back to previous line or at least at separate line.

Can I also somehow get rid off empty lines that appear in output when block is not merged?

Thank you.
By: TomH
Date: 2007-05-04
Time: 13:20

Re: Output formatting problem

Youri,

Looking at the referenced post, here are some ideas for the blank lines - please yhis is psuedo-code from memory when I struggled with this before. you need to fiddle it maybe...
<xxx>
<ul>
  <li>[lev1.pn;block=xxx]</li>
   <yyy>
   <ul>
      <li>[lev2.pn;block=yyy;p1=[lev1.$]]</li>
          <zzz>
          <ul>
          <li>[lev3.pn;block=zzz;p1=[lev1.$];p2=[lev2.$]]</li>
          </ul>
          </zzz>
     
    </ul>
    </yyy>
</ul>
</xxx>

Maybe you will show your code next time - it is easier to help when the actial code is shown -- it is hard to guess what is not showm

Hope that helps a little,
TomH
By: Youri
Date: 2007-05-04
Time: 15:10

Re: Output formatting problem

Thanks for reply, Tom.

I've seen this solution before in some old thread.

Problems:

- Strangely does not hide level 3 if it does not contain any data - shows brackets with block content.

- Blocks are still stuck together, so I can see ending and leading xxx and yyy tags in one line.

- xxx and yyy are not valid tags so I cannot use it anyway as I need valid XHTML.

Idea: Basic ul-li construction is still the same. Is it possible to make something like nested subtemplate which would be inserted into itself as many times as needed?