1. 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?

Discussion in 'XenForo Questions and Support' started by sbj, Feb 2, 2015.

  1. sbj

    sbj Well-Known Member

    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?
     
  2. sbj

    sbj Well-Known Member

    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>
     
  3. Amaury

    Amaury Well-Known Member

    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 likes this.
  4. sbj

    sbj Well-Known Member

    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.
     

Share This Page