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

Recoiling in horror at the complexity of creating templates

Discussion in 'General XenForo Discussion and Feedback' started by jt2011, May 16, 2012.

  1. jt2011

    jt2011 Active Member

    Despite all the wonderful features, why is it so complicated to create templates?
    I don't want a layout like everyone else and simply changing colors does not make a site original.

    PHPBB has a wonderfully simple template system which makes creating completely custom sites a breeze. The reason I do not want to use PHPBB anymore is that it is a resource hog and if you do code customizations they get lost in upgrades.

    I bought Xen yesterday and at first I was excited with the awards functions but now I am frustrated as hell at the lack of ease in customizing my site.

    Is there a step by step guide to creating custom templates or a tool I can use to compile HTML or PHP pages into Xen compatible code?

    As it stands, this software is completely useless to me unless I can change the entire layout and design of the site to exactly the way I need.
     
  2. Floris

    Floris Guest

    CurveGotti and jt2011 like this.
  3. jt2011

    jt2011 Active Member

    @floris
    thank you!
    exactly what I needed
    (y)
     
    Floris likes this.
  4. DBA

    DBA Well-Known Member

    CurveGotti and Floris like this.
  5. jt2011

    jt2011 Active Member

    @floris
    http://xenforo.com/community/resources/screencast-creating-xenforo-add-on.694/
    it says there
    I do not have any button called "Create new addon"
    is this tutorial for v1.1.2?
    Did they move this button or rename it?
    The only button on that page is "Install new addon" and when I click it it shows 2 options, to load a file from server or browse for file to install.
     
  6. jt2011

    jt2011 Active Member

    @DBA
    Thanks. the problem with "Create New Template" is that it does not indicate at all how to use what you create.
    I'll have a look at the links you provided.

    For example, I want to create a new page, and in that new page I want to have a bunch of custom HTML not related to Xen at all. Then I want several columns and in each column it will show recent posts from specific categories.

    [normal xen header with tabs................................................]
    [custom html goes here..........................................................]
    [custom html] [custom html][custom html][custom html]
    [cat 1 post list] [cat 2 post list][cat 9 post list][cat 5 post list]
    [custom html..........................][custom html........................]
    [cat 3 post list] [cat 8 post list][cat 4 post list][cat 6 post list]
    [custom html goes here..........................................................]
    [normal xen footer with links................................................]
     
  7. DBA

    DBA Well-Known Member

    You have to be in debug mode, add this to the top of your config.php file. (add your own IP address)

    PHP:
    if($_SERVER['REMOTE_ADDR'] == '192.168.1.1')
    {
        
    $config['debug'] = true;
    }
     
  8. DBA

    DBA Well-Known Member

    Check out that last link I posted. (y)
    Not saying that this will work for you, but check out the "Create New Page" under the Node Tree.
     
  9. Floris

    Floris Guest

    Sorry, was at the grocery store - and got there just in time. Dinner not ruined!

    Anyway, yeah, you will have to be in debug mode to do any development on XenForo.
    Sorry for not having that more clearly in my tutorials.
     
  10. jt2011

    jt2011 Active Member

    @dba thanks
    running through Floris' tutorials
     
    Floris likes this.
  11. jt2011

    jt2011 Active Member

    ok so I followed Floris' tutorial and created an addon that adds columns to the index page.
    How do I get a list of threads from 1 forum into one of the columns?

    I looked at template: thread_list_item but it is not clear how I can do this
     
  12. Floris

    Floris Guest

    You can make a ControllerPublic/Index.php where you handle what you do in Model/Index.php
    Which helps you create a $yourResult that you can use in your own template to list on the page.
    Such as ..
    A class with a public static function that queries the database to get the data you want.

    $db = XenForo_Application::get('db');
    $userModel = new Xenforo_Model_User;
    $yourResult = array();

    $TempArray = $db->fetchAll("QUERY_HERE");

    Go through the results, and populate the $yourResult to build your array

    And end with return $yourResult;

    Which in the controllerpublic index file you can use for your actionIndex();

    Now that I think of it, there is probably an even easier way to do that. Anyway.
     
  13. ragtek

    ragtek Guest

    Floris likes this.
  14. ragtek

    ragtek Guest

    you could also use the xenforo pages for this;)
    http://xenforo.com/help/nodes/
    Also this http://xenforo.com/help/html-templates/ could help
     
    jt2011 likes this.
  15. designergauravm

    designergauravm New Member

    This is good screenshot. You will have to be in debug mode to do any development on XenForo.
     

Share This Page