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

XF 1.2 URL in conversations

Discussion in 'XenForo Questions and Support' started by snoopy5, Feb 4, 2014.

  1. snoopy5

    snoopy5 Well-Known Member


    I have an addon to send each newly registered user automatically a welcome pm over the conversation.

    This is a predefined text in phrases for this addon. I try now to include there a clickable link within that conversation message, but do not succeed. How can I do this?


    like in

    Last edited: Feb 4, 2014
  2. oman

    oman Well-Known Member

    Which add on is it? You may need to use html if you are editing the text within the phrase.

    You might be better of asking in an add on support thread.
  3. snoopy5

    snoopy5 Well-Known Member

    Hi I tried already html

    <a href="myurl">textforthelink</a>

    But that does not work neither. I do not think that it has something to do wih the addon. This must be general way in Xenforo to have clickable links appearing in phrases. With homurl etc. it does work, so I guess it has to be something similar then.

    But I do not find the solution.
  4. Brogan

    Brogan XenForo Moderator Staff Member

    In a template it is done like so:
    <a class="myClass" href="{xen:link route}">{xen:phrase my_phrase}</a>
    Is that what you mean?
  5. snoopy5

    snoopy5 Well-Known Member

    no, that did not work. Or did I type it wrong?

    <a class="myClass" href="{http://www.urltothread/}">{textforthelink}</a>
  6. Brogan

    Brogan XenForo Moderator Staff Member

    Remove the curly brackets for a hard coded standard URL.

    The curly brackets are for xen:link URLs.

    You should consider using xen:link though as it will automatically update based on the board URL.
  7. snoopy5

    snoopy5 Well-Known Member

    no, does not work neither
    <a class="myClass" href="http://www.myurl">textforthelink</a>
    How do I do it with " xen:link" ? Which part of the url do I put where?

    <a class="myClass" href="{xen:link /urlpartafter_forum_directory/}">{xen:phrase textforthelink}</a>
    Last edited: Feb 4, 2014
  8. xf_phantom

    xf_phantom Well-Known Member


    You can't use HTML or xenforo template helper like xen:link and xen:phrase in phrases:)
  9. snoopy5

    snoopy5 Well-Known Member

    o.k., but how exactly does this has to be written in the code then? There must be some kind of rule in the xenforo system which is independant of any kind of addon?

    Can you post an example with first a full url like http://www.... and then show how you copy& paste it into the code, so that it works?

    As you can see above I have a hard time to get the code snippets working. For example this code:

    does work without any problems in the same phrase. I just do not know how to replace it with my own url and text for my url into it.
    Last edited: Feb 4, 2014

Share This Page