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

XF 1.2 Adding links to dynamic banners above the forum

Discussion in 'XenForo Questions and Support' started by SchmitzIT, Jan 16, 2014.

  1. SchmitzIT

    SchmitzIT Well-Known Member


    I'm using a small hack to display a banner above a forum, when the user is in that particular forum. To accomplish this, I created a template modification doing the following.

    Template: forum_view

    <xen:if is="{$forum.description} AND @threadListDescriptions">
        <xen:description class="baseHtml">{xen:raw $forum.description}</xen:description>
    Replace with:

    <xen:description class="baseHtml">
        <span class="forumbanner{$forum.node_id}"></span>
    This then allows me to add a banner in css:

    .forumbanner1 {
        background-image: url(''myBanner.png');
        float: left;
        width: 728px;
        height: 90px;
        margin: auto;
    However, that leaves me with just a banner image. Now I'd like to add a link to the banner. I tried using pseudo-elements to inject the html:

    span.forumbanner1:before {
     content:<a href=\"https://www.okumafishing.com/resources/news\">;
    However, that won't work as the pseudo-elements do not allow for adding HTML. Does anyone have an idea of how I could possibly dynamically add these links?

    Thanks :)
  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    When you say its dynamic, how so? Are the defined via CSS or something else?
  3. xf_phantom

    xf_phantom Well-Known Member

    Why are you trying to use css?
    Why not add the condition and the link to
    <xen:description class="baseHtml">
    <span class="forumbanner{$forum.node_id}"></span>

Share This Page