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

XF 1.3 Customising the resources

Discussion in 'Styling and Customization Questions' started by Mr Lucky, May 30, 2014.

  1. Mr Lucky

    Mr Lucky Well-Known Member

    I want to add an image to the resources, so that it appears just in the resources section,( both the main resource page and all the resources themselves)

    I want this to appear just below the forum notices and above the title.

    Which template do I edit for this please?
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    You can use one of the ad_ templates and a conditional statement to target the pages you want.
     
  3. Mr Lucky

    Mr Lucky Well-Known Member

    Ok thanks, what would the conditional statement be to show on all resource pages?

    (have checked here: http://xenforo.com/community/resources/conditional-statements.1604/)

    Also I could not find an ad template in the right place

    I tried ad_above_content, but is below the title, I want it above the title but below the notices. Is there on for that?

    Thanks
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    There may not be one in that exact location.
    If there isn't, you will need to edit the templates and include your own custom template.
     
  5. Mr Lucky

    Mr Lucky Well-Known Member

    Are there any instructions on how to do that anywhere?
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    Yes :)

    http://xenforo.com/community/threads/frequently-asked-questions.5183/#post-181112

    How can I find out which template to edit?
    Using your browser, view the page source and look for a line of code near the top of the page which begins
    <div id="content" class="; the class is the name of the template. So for the main forum page, the line of code is:<div id="content" class="forum_list">, which makes the template forum_list.


    How do I include a template?
    Code:
    <xen:include template="name_of_template" />
     
  7. Mr Lucky

    Mr Lucky Well-Known Member

    Thanks for that, but I'm still a bit confused.

    So do I create a new template based on an edited version of an exiting one and give it a name, then include it in PAGE_CONTAINER?

    And what do I sue for a conditional statement to make it only appear on resources?

    Thanks
     
  8. Brogan

    Brogan XenForo Moderator Staff Member

    Create a new template, call it something unique.

    Include it in the templates where you want it to show.
     
  9. Mr Lucky

    Mr Lucky Well-Known Member

    OK, I'm getting there, but i think I need xenforo for dummies! :) Please be patient

    I have created the template ad_resource_above_title, edited it with my content, and included it in PAGE_CONTAINER just above {xen:raw $contents}

    I thought that would place it above the title, but when viewing resources, it is below the title.

    Where do I need to include it to show above the title (but below notices?)

    Thanks
     
  10. Mr Lucky

    Mr Lucky Well-Known Member

    OK, have found where to put it above title.

    Are you able to tell me what conditional to show on the resource index page and in all the resources, but not on the forums or threads?

    Thanks
     
  11. Brogan

    Brogan XenForo Moderator Staff Member

    Use your browser inspection tool to check the page names:

    Using your browser, view the page source and look for a line of code near the top of the page which begins
    <div id="content" class="; the class is the name of the template. So for the main forum page, the line of code is:<div id="content" class="forum_list">, which makes the template forum_list.

    Then add the page names into an array like so:
    Code:
    <xen:if is="in_array({$contentTemplate}, array('page_1', 'page_2', 'page_3'))">
     
  12. Mr Lucky

    Mr Lucky Well-Known Member

    OK thanks, but the resources are always changing, so is there no way to just make it appear on all pages of the resources, iefor which the resource tab is selected?
     
  13. Brogan

    Brogan XenForo Moderator Staff Member

    The name of the page (template) remains the same, regardless of the resource/content.

    upload_2014-5-30_18-5-35.png
     

Share This Page