[PHPTAL] html entitiy confusion

Richard Standbrook richard at cyberware.co.uk
Mon Nov 19 10:52:12 CET 2007


Aaron,

Did you notice the structure modifier David used?

>  <div class="post_text" tal:content="structure post/post_time">

'structure' stops PHPTAL from encoding the output, allows you to  
output XML(HTML) structure.

Richard Standbrook
---
Senior analyst programmer
richard at cyberware.co.uk
+44 (0)1733 765050

Registration no: 03160139
Litton House, Saville Road, Westwood, Peterborough, England, PE3 7PR

NOTICE: The information contained in this email and any attachments is
confidential and may be privileged. If you are not the intended  
recipient
you should not use, disclose, distribute or copy any of the content of  
it or
of any attachment; you are requested to notify the sender immediately of
your receipt of the email and then to delete it and any attachments from
your system.



On 17 Nov 2007, at 19:52, Aaron Forsander wrote:

> Thanks for the advice, that helps me clean up my code a great deal.
>
> Unfortunately,after making those changes, I still have the same issue,
> phptal converts strings to html entities.  :(
>
> - Aaron
>
>
> On Nov 17, 2007 1:29 PM, David Zülke <dz at bitxtender.com> wrote:
>> Aaron,
>>
>> 1) no need for that span element, you can loop using the div
>> 2) you're not using the "proper" way to output data, which also means
>> you cannot have the literal values printed
>>
>> Do it like this:
>>
>> <div class="comment" tal:repeat="post posts">
>>   <div class="post_author" tal:content="post/post_author">Joe Cool</
>> div>
>>   <div class="post_time" tal:content="post/post_time">February 30</ 
>> div>
>>   <div class="post_text" tal:content="structure post/post_time">Dummy
>> text here</div>
>> </div>
>>
>>
>> HTH,
>>
>> David
>>
>>
>>
>>
>> Am 17.11.2007 um 19:37 schrieb Aaron Forsander:
>>
>>
>>> I have no clue how this is going to look as I am using a lot of html
>>> here, you might need to view the email in plain text.
>>>
>>> A post looks something like this:
>>>
>>> post->id = 1
>>> post->post_time = 2007-11-16 18:14:44
>>> post->post_author = someone
>>> post->post_text = <a href="http://www.url.com"> blah </a>
>>>
>>>
>>> And I am iterating through several of these.  My phptal template  
>>> looks
>>> something like this:
>>>
>>> <span tal:repeat="post posts" tal:omit-tag="">
>>>      <div class="comment">
>>>               <div class="post_author">${post/post_author}</div>
>>>               <div class="post_time">${post/post_time} </div>
>>>               <div class="post_text">${post/post_text}</div>
>>>       </div>
>>>   </span>
>>>
>>> Currently, PHPTAL replaces
>>> post->post_text = <a href="http://www.url.com"> blah </a>
>>> with
>>> post->post_text = &lt;a href=&quot;http://www.url.com&quot;&gt; blah
>>> &lt;/a&gt;
>>>
>>>
>>> I need to display an actual working html link and not the link with
>>> html entities.
>>>
>>> Any idea how to do this?
>>>
>>>
>>>
>>> On Nov 17, 2007 12:14 PM, Levi Stanley <levi at eneservices.com> wrote:
>>>>
>>>> Hi Aaron Forsander:
>>>>
>>>> Could you post some code so I can see what you are trying to do?
>>>>
>>>> Best regards,
>>>> Levi
>>>>
>>>> Aaron Forsander wrote:
>>>> Hi everyone, I have a question about html entities and what not in
>>>> phptal.
>>>>
>>>> I have stuff in a database that contains html. When ever I output
>>>> that stuff in phptal, it converts it to html entities. I don't want
>>>> this to happen :). Is there a way I can turn off that feature, or
>>>> perhaps override it?
>>>>
>>>>
>>>> Thanks,
>>>> Aaron
>>>>
>>>> _______________________________________________
>>>> PHPTAL mailing list
>>>> PHPTAL at lists.motion-twin.com
>>>> http://lists.motion-twin.com/mailman/listinfo/phptal
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>>
>>>>
>>>> Levi Stanley - <levi at eneservices.com>
>>>> Manager
>>>>
>>>> ENE Services, LLC - http://www.eneservices.com
>>>> ________________________________
>>>>
>>>> (M): 954-678-0275
>>>> (F): 866-405-9514
>>>> _______________________________________________
>>>> PHPTAL mailing list
>>>> PHPTAL at lists.motion-twin.com
>>>> http://lists.motion-twin.com/mailman/listinfo/phptal
>>>>
>>>>
>>>
>>> _______________________________________________
>>> PHPTAL mailing list
>>> PHPTAL at lists.motion-twin.com
>>> http://lists.motion-twin.com/mailman/listinfo/phptal
>>>
>>
>>
>> _______________________________________________
>> PHPTAL mailing list
>> PHPTAL at lists.motion-twin.com
>> http://lists.motion-twin.com/mailman/listinfo/phptal
>>
>
> _______________________________________________
> PHPTAL mailing list
> PHPTAL at lists.motion-twin.com
> http://lists.motion-twin.com/mailman/listinfo/phptal




More information about the PHPTAL mailing list