TinyButStrong - the PHP Template Engine
Categories > TinyButStrong general >

Automatically create a new <p>?

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs

By: Fabrizio Lodi
Date: 2016-04-15
Time: 18:14

Automatically create a new <p>?

I have this piece of code:

                <div class="box-content">
                    <p>
                        <strong>[bAtt.descr;block=p]</strong><br>
                        [bAtt.code;onformat='EC_getAtt';a='[bAtt.name]';strconv=no]
                    </p>
                </div>

where the EC_getAtt return a <ul>...</ul>

The resulted HTML is

                <div class="box-content">
                    <p>
                        <strong>[bAtt.descr;block=p]</strong><br>
                    </p>
                    <p>
                        <ul> .... </ul>
                    </p>
                </div>

Someone have an idea on why this happens?

Thank you
By: Skrol29
Date: 2016-05-10
Time: 00:53

Re: Automatically create a new <p>?

I cannot explain this.
You should check the content of [bAtt.code] without onformat.
By: Fabrizio Lodi
Date: 2016-05-10
Time: 10:07

Re: Automatically create a new <p>?

[bAtt.code] contains an alphanumeric code, [bAtt.name] contains the name of an attribute.. 'EC_getAtt' uses that code and the attribute name to get the values of that attribute for the item with that code, and return it as an <ul>.

What i do not understand it is why the <p> is closed and reopened as a result.
By: Skrol29
Date: 2016-05-11
Time: 01:00

Re: Automatically create a new <p>?

> What i do not understand it is why the <p> is closed and reopened as a result.

TBS simply don't manage the tags <p> and, </p>. It has only defined the bound of the block by searching those snippets.
So the tags can only come from the bounds of the block or from the source of your merged data.

The first thing to check is the source of the data merged with block "bAtt", and the values returned by the function EC_getAtt().

By: peter
Date: 2016-07-26
Time: 16:24

Re: Automatically create a new <p>?

Where are you used this code?
By: flodi
Date: 2016-07-27
Time: 19:29

Re: Automatically create a new <p>?

What do you mean?