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

forum.node_id conditional in editor_js_setup not funtioning

Discussion in 'XenForo Development Discussions' started by MOZ, Aug 10, 2012.

  1. MOZ

    MOZ Well-Known Member

    So, I am rearranging some buttons in the TinyMCE editor, I want to use the forum.node_id conditional however it won't work.

    This is how I have it:

    Code:
    theme_xenforo_buttons2 : 'bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,adv_cust_staff,|,bullist,numlist,outdent,indent,|,<xen:if is="{$forum.node_id} == 28">link,unlink,</xen:if>image,xenforo_media,|,xenforo_code,xenforo_custom_bbcode',
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    The params for the editor template are defined in this file:

    library/XenForo/ViewPublic/Helper/Editor.php

    Code:
    		return $view->createTemplateObject($templateName, array(
    			'showWysiwyg' => $showWysiwyg,
    			'height' => $height,
    			'formCtrlNameHtml' => $formCtrlNameHtml,
    			'formCtrlName' => $formCtrlName,
    			'editorId' => $editorId,
    
    			'message' => $message,
    			'messageHtml' => $messageHtml,
    
    			'smilies' => ($showWysiwyg ? self::getEditorSmilies() : array()),
    
    			'editorOptions' => $editorOptions,
    		));
    
    The forum record is not there. It would have to be added.

    Or create a new style and assign it to the forum in question.
     
  3. MOZ

    MOZ Well-Known Member

    Okay. What do you mean by "create a new style and assign it to the forum in question"?
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Admin CP -> Applications -> Display Node Tree -> [click the forum] -> Style
     
  5. MOZ

    MOZ Well-Known Member

    I understand that, what I meant is how would I use that for the conditional.
     
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Creating different styles per forum can be used instead of a template conditional that checks the node_id.
     
  7. MOZ

    MOZ Well-Known Member

    Ah. okay.
     

Share This Page