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

XF 1.1 Ability to choose different template for thread_view per forum

Discussion in 'XenForo Questions and Support' started by simbolo, Jan 27, 2012.

  1. simbolo

    simbolo Well-Known Member

    Purpose:
    Create a different looking thread view for threads within a node. I know I can set a different style but would like to avoid creating a secondary style with the only modification being one template. Plus this would be tricky with styles that are basically the same but with different colors. Essentially I'd like to setup the following:

    Forum "Articles" -> template "thread_view_article"
    Forum * -> template "thread_view"

    Example: My "Article/Blog" Pages should have a different layout then the standard forum post.

    So my question is there any plugin for this currently and, if not, would it be possible?
     
  2. optrex

    optrex Active Member

    I'd like to create the same. you mentioned you'd figured out how Jaxel had changed his. Would be grateful for a share.
    I'd like to combine first post display on all pages / comments in reverse order (newest first) for one specific forum.
     
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  4. ragtek

    ragtek Guest

    It's also possible to do it inside of the XenForo_ViewPublic_Thread_View (which can be extended, so you don't need to overwrite templates or files;)

    PHP:
    class Ragtek_Bazar_Thread_View extends XFCP_Ragtek_Bazar_Thread_View
    {
        public function 
    renderHtml()
        {
            
    parent::renderHTML();
            
    $bazarNodes Ragtek::options('bazarnodes')->toArray();

            
    $params $this->getParams();
            if (
    in_array($params['thread']['node_id'], $bazarNodes))
            {
              
    $this->_templateName 'ragtek_bazar_threadview';
            }
     

Share This Page