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

XF 1.4 CSS and Node Id Help needed

Discussion in 'Styling and Customization Questions' started by pfernand, Mar 1, 2015.

  1. pfernand

    pfernand Member

    Can somebody tell me how I can place a banner image on a specific forum or category in the main forum view using CSS and node id? My forum is --> theplugyourconnect.com and below is an image of what I am trying to accomplish. A million thanks for your help!
    forum-view.PNG
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Example:

    Code:
    .node.node_2 .nodeTitle a:after
    {
    	content: url('path/to/image.gif');
    }
    
     
  3. pfernand

    pfernand Member

    Thank you Jake.
    1. How do I make my banner clickable (i.e. direct to ad website)?
    2. Do I add this code to the EXTRA.CSS template or is there a more appropriate place to add the css?
     
    Last edited: Mar 2, 2015
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    1) That can't be done with CSS. You might consider editing the HTML template directly:

    Admin CP -> Appearance -> Templates -> node_forum_level_2

    2) Yes, custom CSS like this should go in EXTRA.css
     
    IPF likes this.
  5. pfernand

    pfernand Member

     
  6. pfernand

    pfernand Member

    Is the <div class="nodeText"> section in the node_forum_level_2 template where I need to modify in order to make a forum banner clickable? Would this be a series of if conditions based on node id? If so, can you PLEAE PLEASE help me with the syntax. I'm very new to XF and I'm not sure how to code my changes.

    I'd like to display maybe 2 or 3 banners on different forums. I want visitors to be able to click on the banner and be taken to the respective sponsor's website via new tab. My site is theplugyourconnect.com.

    I would be so very grateful for you help. Thank you!
     
  7. pfernand

    pfernand Member

    Help please. Anybody?!?!?!?
     
  8. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    The XF conditional syntax would be like this:

    Code:
    <xen:if is="{$forum.node_id} == 2">
    
    </xen:if>
    
    That will show HTML code only for node_id 2.
     
  9. pfernand

    pfernand Member

    Thank you, Jake. My banner is visible and clickable. However, is it possible to display the banner next to the forum title instead of below it (see snapshot below).
    forum-view.PNG
     
  10. pfernand

    pfernand Member

    Is it possible to display my forum topic ad in the same line as the topic title (see attachment)? I tried adding the following css to my EXTRA.css but it didn't have any impact. I'd appreciate any help. Thank you.

    .node.node_27 .nodeTitle a:after
    {
    content: url('styles/*******/Boron/xenforo/ads/your-ad-here-350x35.png');
    float: right;
    width: 400px;
    }
     
  11. pfernand

    pfernand Member

    Anybody? Please? I know there's a lot of smart people out there. Is this something I can fix with css or do I need to modify a template?
     

Share This Page