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

XF 1.4 How to phrase template?

sbj

Well-known member
#1
Hey,

how can I phrase this?

Code:
<p>
  <a href="http://MyForum.com/watched/threads/all/">Watched Threads</a><br>
  <a href="http://MyForum.com/account/likes">Likes Received</a><br>
...
</p>
In one custom template of mine I have this code and it works fine. It shows those links. But how can I phrase this (with html) so when the default language of my forum changes, that the names "Watched Threads, Likes Received" change, too?

Of course I have already installed another language and those key words are phrased. So in their default places the language change works. But this code is from a custom template.

Any ideas?
 

sbj

Well-known member
#2
Thanks @AndyB

Code:
  <a href="http://MyForum.com/watched/threads/all/">{xen:phrase watched_threads}</a><br>
  <a href="http://MyForum.com/account/likes">{xen:phrase likes_received}</a><br>
 

Amaury

Well-known member
#3
For reference, if you don't know what the phrase title is (e.g., if the phrase title were different from the phrase text, such as your_watched_threads), do a search for the phrase text and you'll find it.

But yeah, it's always best to use phrases rather than hard-coded text.
 

sbj

Well-known member
#4
Yeah, good tip, I do that. Thanks.
My problem was this part:
Code:
{xen:phrase ...}
I tried that before but it didn't work because I didn't know that I have to use brackets. So I thought this can't be the solution because it looks so simple.
But actually it was really as simple as that, just I had to use brackets. Thanks Andy who helped me out.