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

XF 1.5 How to make links clickable in a Xenforo notice

Discussion in 'XenForo Questions and Support' started by Magnoun, Jan 10, 2016.

  1. Magnoun

    Magnoun New Member

    Hey I'm trying to put some thread links in some xenforo notices In my forum but I can't figure out how to make the links clickable. Would greatly appreciate it if someone could tell me how.

    Thanks
     
  2. Amaury

    Amaury Well-Known Member

  3. Magnoun

    Magnoun New Member

    Thank you, that worked but I tried giving the links color and so I added the html links color code that they give which is this one
    But it actually changed the colors of all the threads and forum titles, is there a way to set it to where it only affects the notice?

    Thanks
     
  4. Amaury

    Amaury Well-Known Member

    That would indicate malformed HTML. You likely just forgot a closing curly bracket somewhere or something of that nature.
     
  5. Mr Lucky

    Mr Lucky Well-Known Member

    That is the wrong way to do what you want. What you did was use the style element which does indeed affect the entire content, whether in the header or within the body content as it is in a notice. (I think technically speaking these should go in the header anyway)

    What you need in this case is an inline style within the tag itself e.g.

    Code:
    <a style="color:red" href="http://whatever">link text</a>
    However when it's more complex as in your case (different colours for state of link) it's probably better to do it with a class.

    In this case, add your CSS to the extra.css template and give the links a class, e.g. noticelink

    Code:
    a.noticelink:link {color:green;background-color:transparent;text-decoration:none}
    a.noticelink:visited {color:pink;background-color:transparent;text-decoration:none}
    a.noticelink:hover {color:red;background-color:transparent;text-decoration:underline}
    a.noticelink:active {color:yellow;background-color:transparent;text-decoration:underline}
    Then in your notice:

    Code:
    <a class="noticelink" href="http://whatever">link text</a>
     
    Last edited: Jan 11, 2016

Share This Page