Termination of templates rendering

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
LazyBadger
Regular
Posts: 176
Joined: Mon Aug 25, 2008 12:25 pm
Location: Russia
Contact:

Termination of templates rendering

Post by LazyBadger »

Maybe it's bug, maybe not. But, anyway, I was surprised
During testing of event_relatedlinks I wrote slightly modified template

Code: Select all

<!-- 24 марта 2011 г. 2:39:01 relatedlinks start -->
<h4 class="serendipity_relatedlinks serendipity_title">{$plugin_relatedentries_html_intro}</h4>
...
(note russian text inside HTML-comment) and forgot to save as UTF8-file, leave it with default windows-encoding.
When I saw at created page, I can to see only "<!-- " as text on page instead of full template.
I suppose, it's bad style, butnot sure can it be avoided
Quis custodiet ipsos custodes?
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Termination of templates rendering

Post by Timbalu »

you should save it as ANSI if it is a *.tpl
Is this tpl working if you dont use the <!-- -->?
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
LazyBadger
Regular
Posts: 176
Joined: Mon Aug 25, 2008 12:25 pm
Location: Russia
Contact:

Re: Termination of templates rendering

Post by LazyBadger »

Timbalu wrote:you should save it as ANSI if it is a *.tpl
Is this tpl working if you dont use the <!-- -->?
I must save it as UTF8 in order to get working template
Template work with OR conditions
- ANSI-file haven't any 8-bit text
- 8bit texts are UTF8
Quis custodiet ipsos custodes?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Termination of templates rendering

Post by garvinhicking »

Hi!

If not saved in UTF-8, the file parsing gets corrupted with invalid characters, I don't think there's a proper way to prevent breakage.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Termination of templates rendering

Post by Timbalu »

You mean OR like || ? I never realized this. :shock:
Usually tpl files are signed as ANSI in my notepad++ and I never had problems saving them....
But I see, if one has
<?xml version="1.0" encoding="utf-8" ?>
its utf8 without BOM like feed_opml1.0.tpl.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Post Reply