• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fixed  phrase does not get translated correctly

Garani

Active member
#1
Hi all!

I am starting to play with the templates and add-ons and I have found a possible bug.

I am working on the thread_create template to add a DIV that draws a box so that I can upload some more info for that thread. The code I have put in place is (I have cut out the rest of the code):

HTML:
        <div id="photo-upload-box">
                <h1>{xen:phrase iio_optional_fields}</h1>
<SNIP>
        </div>
I have a phrase in Master Language with title: iio_optional_fields and content "Optional Fields"

When the page is rendered the HTML that I get is the following:

HTML:
        <div id="photo-upload-box">
                <h1>Create Thread</h1>
<SNIP>
        </div>
The rest of the phrases are displayed correctly, but not this one. I wonder if I stumbled on a bug or I am missing something along the line...
 

Attachments

Garani

Active member
#3
Brogan, that isn't the problem, but I can now confirm that there is a bug, or at least an "undocumented" feature.

BEHAVIOUR
If the code tread_create.html code is like this:
HTML:
<h1>What ever you write, a static or a xen statement</h1>
The code that gets displayed in the browser is:
HTML:
<h1>Create Thread</h1>
REASON
This happens when ever you use the h1 tag, in any position within the tread_create template. I have turned off Javascript and it turns out that things are correctly displayed.

SOLUTION
So the point is that within the thread_create template you can't use the H1 html tag, since Javascript is atually manipulating that.
 

Mike

XenForo developer
Staff member
#4
It happens because of the live title code, which I've changed to only fall back to the first H1 on the page.