[Typo3-dev] locallang.xml +HTML Tag

Christopher bedlamhotel at gmail.com
Mon Jul 25 18:21:58 CEST 2005


Hi,

On 25/07/05, Chris Wittmann [SwiftLizard] <chris at swift-lizard.com> wrote:
> Hi Folks,
> 
> i hope i´m right in here,.. i got some problems with my csh_de,..
> in detail with the locallang.xml files of the indexed-search-engine.
> 
> One of my customers wanted to have special parts of the locallang.xml
> text in bold letters others underlined.
> 
> My problem is, if i put some html tags into the locallang.xml, in
> frontend only the word array is renderd. some kind of weired..
> 
> So my question is how do i get some of the text bold, italic or
> underlined or even wraped by some div-tags ?
> 
> to get my point some of the source i want to get:
> 
> <label index="rules_text">
>         <b>Tipps für die Suche:</b>
>         <br/>
>         <br/>
> 
>         Suchworte müssen mindestens 2 Zeichen haben
>         Maximal 200 Zeichen insgesamt
>         <br/>
>         <br/>
> 
>         <u>Mehrere Suchbegriffe:</u>
>         <br/>
>         <br/>
> 
>         1. Leerzeichen oder UND: zeigt nur die Inhalte, die alle
>            Suchbegriffe enthalten
>         2. ODER: zeigt die Inhalte, die alle oder nur einen der
>            Suchbegriffe enthalten
>         3. NICHT: zeigt nur die Inhalte, die den ausgeschlossenen
>            Suchbegriff nicht enthalten
>         4. +/|/- entspricht UND, ODER und NICHT als Operatoren
>         5. Groß- und Kleinschreibung wird nicht berücksichtigt
> </label>
> 
> Anyone of you a good ideas?
> 
> perhaps my problems is that php5 is running on that server.

"<", ">", "--" and "&" are reserved in xml, so by inserting html that
includes '<' or '>', you're messing up the xml file. You need to keep
the parser from working on the markup inside <label>, so try this way
instead:

<label index="rules_text">
  <![CDATA[
    <b>Foo</b><br />
    <i>bar</i>
  ]]>
</label>

'cdata' should be ignored by an xml parser. Alternatively, you could
escape all '<' and '>' going into the xml file to &lt; and &gt; and
back on the way out, but this might be impractical...

-Christopher




More information about the TYPO3-dev mailing list