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

country-list at homepage and categories or forums per country

Discussion in 'XenForo Questions and Support' started by erich37, Mar 9, 2011.

  1. erich37

    erich37 Well-Known Member

    I am thinking of having on the Homepage just a list of about 120 countries, so nothing else but countries and the logo. Probably having a static page or preferable a XF-page with just a list of countries.

    Then when a user clicks on any country, he will be forwarded to the Forum, or respectively to the Country-Category or Country-Forum.

    So literally I would like to run a Forum for each of about 120 countries, but I do not want to have those 120 countries listed as Forums or Categories on the Homepage itself.

    So for example similar to Craigslist, where you have a list of countries and then being directed to the country-category or country-forum.

    How to do this ?

    Appreciate your help.
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    You could always just uncheck Display in the node list for each category/forum.

    The forum will still be accessible if the URL is known, or via a direct link.

    Then just add some custom template/page code to achieve what you want.
    Presumably you mean something similar to this but obviously smaller and just with flags?
    http://www.cliptheapex.com/community/pages/circuits/
     
    erich37 and James like this.
  3. James

    James Well-Known Member

    If you set your node lists to not display then they won't actually appear on the forum listing, but you can access them via their respective URLs.
    [​IMG]

    You could then create hyperlinks from each country to their respective forum/category. A lot of manual labour...

    Ninja'd :( I'mma blame the image uploading...
     
    Brogan and erich37 like this.
  4. erich37

    erich37 Well-Known Member

    thanks Brogan!

    this is what I was thinking about, but how do I get a XF-page being the Homepage?
    Or how do I get the "Country-List" to be shown on the Homepage, without the need of creating a XF-page?
     
  5. Brogan

    Brogan XenForo Moderator Staff Member

  6. James

    James Well-Known Member

    Never tried it before, but you could use .htaccess (assuming you use apache) to set your default homepage to the XF page:
    http://www.javascriptkit.com/howto/htaccess6.shtml

    EDIT: If this doesn't work, create a new PHP file in your root called home.php and put inside:
    PHP:
    <?php header('Location: path/to/xf/page'); ?>
    Then update your .htaccess to:
    Code:
    DirectoryIndex home.php
    
     
  7. erich37

    erich37 Well-Known Member

  8. Brogan

    Brogan XenForo Moderator Staff Member

    That's what I do, in conjunction with a home.php file to use one of my Pages as a 'home' page.


    That would require editing the forum_list template in that case.
    You could create a new template and include it in forum_list.
     
    erich37 and James like this.
  9. James

    James Well-Known Member

    Damn.. I just updated my post with a home.php edit... love your thinking Paul.
     
  10. erich37

    erich37 Well-Known Member

    is there a specific template which I could use as an example of how this "new template" should look like ? Or is it just plain HTML with some div-tags ?
     
  11. Brogan

    Brogan XenForo Moderator Staff Member

    It's a custom template so it would be up to the individual (i.e. you) how it would look.

    You need to come up with a design/layout and then people can help you getting it set up.
     
  12. James

    James Well-Known Member

    Wait a minute... I've just had a brainwave.

    XenForo pages are stored as templates, right? So why can't we just edit the forum_list template to something like:
    Code:
    <xen:include template="_page_node.id" />
    Erich doesn't want the forum list showing anyway, so why not do it that way... hmm...
     
    Brogan and erich37 like this.
  13. Brogan

    Brogan XenForo Moderator Staff Member

    Yes, you can do that no problem although essentially that would be no different to creating your own template and including it.

    Ultimately though he needs to come up with a design and layout for the template, whichever one he decides to use.
     
  14. James

    James Well-Known Member

    If you're using a page, wouldn't the usual XenForo classes be applied?
     
  15. Brogan

    Brogan XenForo Moderator Staff Member

  16. erich37

    erich37 Well-Known Member

    Having a XF-page with a list of countries..... and then having this at the Homepage like "xenforo.com"..... that would be perfect I guess....

    So the other question is: how to create a XF-page as being the Homepage.... at domain.com
    ? Do we have a tutorial for this somewhere already?
     
  17. Brogan

    Brogan XenForo Moderator Staff Member

    If you install the forum in the root instead of e.g. /community and replace the forum_list template with your custom code then it should work.

    A fairly different approach to a forum but if that's what works for you...why not.
     
  18. James

    James Well-Known Member

    So them 3 classes, once applied, will:
    • defining the font settings (messageText)
    • styling URL links (ugc)
    • resetting the html back to “normal” (baseHtml)
    Would this then allow Erich to use the default XF classes, such as newIndicator, instead of creating a whole new stylesheet?
     
  19. Brogan

    Brogan XenForo Moderator Staff Member

    I'm not entirely sure as I've never tried to use all of the classes.
    But certainly classes such as sectionMain, primaryContent, etc. all work.

    However, he wouldn't need the newIndicator class or any others to do with posts, etc. as it would just be an entry page with a list of countries.
     
    James likes this.
  20. James

    James Well-Known Member

    I used that class because it was the first one I came across during my inspect element.

    I'm not sure if there's any benefit between using a template or using a page node to include in forum_list. Does the page node have any benefits over a template when the classes are applied?
     

Share This Page