>> I've implemented the truncateText method to control oversized text in a
>> product list.
> 
> Too bad, it was already done: a4d.utils.truncateText.
> 
> The standard libraries are full of goodies that will save you time.

Sorry, bad English. I didn't implement my own  truncateText method but I
implemented a4d.utils.truncateText into my code.


>> The problem is, the content of a text field with multistyle enabled is plain
>> text - until you implement any style. At that point 4D not only adds the
>> style to that portion of the text, but encloses the whole text with <span>
>> </span>.
> 
> Are you mixing 4D tags with Active4D? If so, you are on your own, I can't help
> you.

No, I use NTK. All I do is output a 4d textfield that has multistyle
enabled. It is the easiest way to generate styled text within 4D without the
need for additional plugins and you can see the result directly in your 4D
form field without the need for using webareas etc.

Here is an example of the content of that field with the word Wreckage
styled as bold:

<span>In the post-apocalyptic world of <span style="font-weight:
bold;">Wreckage</span>, the landscape is a twisted wasteland. Road warriors
rule the highways in souped-up vehicles decked out with guns, armor, and
turbo-charged engines. The best of these gasoline gladiators have come
together to compete in the arena of death. The winner is awarded fuel for a
year, water for a month, and the glory of the kill. The losers are
wreckage.</span>

To output this I have to use the a4d command "write raw".

The problem is, that a4d.utils.truncateText chops off the closing </span>
instead of leaving the tag in place, which is essential to keep the HMTL
structure.

Hope this makes it clearer.

Peter




_______________________________________________
Active4D-dev mailing list
[email protected]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/

Reply via email to