zpt

Line Breaking in Chameleon

巧了我就是萌 提交于 2020-01-04 05:11:31
问题 I have used the pyramid framework to build a large web application. Among other things, this application allows the user to enter text into a text area form field. This text is then saved to a database and of course can be readout again and displayed later. To display content I am using the Chameleon Template Engine. This works fine, except that line breaking is not displayed correctly (not displayed at all). This is probably due to the fact that the newlines entered into the text area do not

How to make a file with .pt extension, with xml syntax highlighting and vim's plugin snipmate load pt.snippets?

∥☆過路亽.° 提交于 2020-01-03 05:49:36
问题 I have the following in my .vimrc : au BufNewFile,BufRead *.pt set filetype=xml This is needed because although I'm editing a file with *.pt extension, it's indeed a valid xml file: setting the filetype like this I can have syntax highlighting. I'm using vim's snipmate plugin, and tried to create pt.snippets to specific needs since these files are Zope Page Templates (ZPT with TAL). Now, I have a problem: I don't want to create these snippets in xml.snippets, since they aren't really generic

How to set TAL condition to check the file type and accordingly render the template in Plone 4.1

懵懂的女人 提交于 2019-12-11 09:42:25
问题 How to use the tal condition to check the file type and render the template in Plone 4.1 My file preview template rendering depends upon the file extension. If file extension is 'pdf', I wish to use something like this:(just started working with TAL, TALES, METAL) <tal:define="file_nm global string:${here/absolute_url}" <tal:condition="file_nm.slice[-3:] = 'pdf'"> <embed width="100%" height="100%" name="plug-in" tal:attributes="src string:${here/absolute_url}#" draggable="false" onselectstart