Categories > TinyButStrong general >

HTML result formatting

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Marcos Neves
Date: 2005-01-11
Time: 20:03

HTML result formatting

Hi, The follow template:
<ul>
    <li>[list.label;block=li]</li>
</ul>
became this when parsed:
<ul>
    <li>Marcos</li><li>Neves</li>
</ul>
How can I make it became exactly this:
<ul>
    <li>Marcos</li>
    <li>Neves</li>
</ul>
By: Marcos Neves
Date: 2005-01-11
Time: 20:29

Re: HTML result formatting

The tab doesn't shows. I replace than with dot (.)

Hi, The follow template:
<ul>
..........<li>[list.label;block=li]</li>
</ul>

became this when parsed:
<ul>
..........<li>Marcos</li><li>Neves</li>
</ul>

How can I make it became exactly this:
<ul>
..........<li>Marcos</li>
..........<li>Neves</li>
</ul>
By: Skrol29
Date: 2005-01-12
Time: 00:43

Re: HTML result formatting

Hi Marcos,

So you have consideration about your Html source viewed by visitors ;)

What you ask is possible only with the exlicit syntax, because spaces and beak line are touside the <li> tags.
<ul>
[list;block=begin]..........<li>[list.label]</li>
[list;block=end]</ul>
By: Marcos Neves
Date: 2005-01-12
Time: 03:51

Re: HTML result formatting

Hi,

This is the way I was using. But my consideration is not exactly by the visitor, but for me and my team that use Web Standards. ;)
As a programmer, I can see that would be possible to look for a open tag and catch all the spaces that comes before. This could be switched by a parameter named fhtm(formatHtm) for example.

I think almost every designer would like this behaviour.

Now cames a new idea. A parameter named ident=n could do this very easy I think.
My example above could be:
<ul>
..........<li>[list.label;block=li;ident=10]</li>
</ul>
other parameter could set the ident character, but I think this parameter should be global and only overloaded by a local parameter.

But again, would be very nice if the API could found this for us :-D

If this behaviour brings overhead to the API, it could be switched to those that need very very fast parsing.

What do you thing? :-D
By: Skrol29
Date: 2005-01-12
Time: 10:42

Re: HTML result formatting

Hi,

But the Dev Team is not supposed to work with the Html source which results from the merge. Or maybe only to check its Html validity. Dev Team is interested by the Html source of the template.

Technically, a new parameter 'indent' for blocks is not difficult to do.
And maybe it could be without value: it can be able to found it itself the existing indentation. Another possibility is to define block=line where 'line' is a special keyword. But it is a bit touchy because a Visual Editor such as Dreamweaver can break the line by itself.
Before to add such a feature I have to check if it's wanted by other users, and if it cannot be done another way.

Did you try with personal tags?
<ul>
<mytag>..........<li>[list.label;block=mytag]</li>
</mytag></ul>
At the end of the merge, you can clear the <mytag>.
By: Marcos Neves
Date: 2005-01-12
Time: 12:22

Re: HTML result formatting

Hi,

A beauty output helps to find wrong tags and wrong nesting.

In your suggestion, how can I remove the custom tag? You mean using a custom function mine?
By: Skrol29
Date: 2005-01-12
Time: 12:58

Re: HTML result formatting

I can see two ways to delete your custom tags.

At the PHP side:
  $TBS->Source = str_replace('<mytag>','',$TBS->Source);
  $TBS->Source = str_replace('</mytag>','',$TBS->Source);

Or, in the template:
<ul>
<mytag [onshow;friend=mytag;mtype=m+m]>..........<li>[list.label;block=mytag]</li>
</mytag></ul>

This is smart, but don't use too much friend parameters.