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

List of Format Parameters for each Format Type

Discussion in 'XenForo Development Discussions' started by tenants, Apr 28, 2012.

  1. tenants

    tenants Well-Known Member

    Is there a list of "Format Parameters" availed for each of the Format Types

    For instance, I want to design a plug-in that uses a text-box. But I want the text box to have a Max char size of 140 characters

    I've tried Max=140, but this doesn't limit it

    To a text box, I know you can add the rows, eg:
    rows=3

    But it would be useful to have a list of all the options for all of the Format Types for future reference ;)
     
  2. DSF

    DSF Well-Known Member

    Has nobody a list of "Format Parameters"?
    I need a parameter to allow her some HTML-Statements.
    Or with other words: '<br>' shall be executed and not 'stripped'.
     
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    What is the usage? Are you using xen:textboxunit in a template?

    Where do you need to allow HTML? In user posts?
     
  4. DSF

    DSF Well-Known Member

    No no, never for posts!
    I enter the text in ACP only for a message via a Listener and Hook to the sidebar.
    It's works perfekt ... but no simple formating like as <br> is possible.
     
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Maybe this?

    http://us.php.net/manual/en/function.nl2br.php
     
  6. ragtek

    ragtek Guest

    HTML Purifier ( http://htmlpurifier.org/ ) allows to have a white list of tags and everything else will be stripped:)
     
  7. ragtek

    ragtek Guest

    Just check the XenForo_Template_Compiler_Tag_Admin_X Classes


    All the Types have a own class, with the controloptions
    e.g => XenForo_Template_Compiler_Tag_Admin_SpinBoxUnit => $controlOptions = $this->_getControlOptions($compiler, $attributes, array('maxlength', 'size', 'min', 'max', 'step'));


    XenForo_Template_Compiler_Tag_Admin_TextBoxUnit =>
    $controlOptions = $this->_getControlOptions($compiler, $attributes,
    array(
    'type', 'maxlength', 'size', 'rows', 'code', 'dir', 'placeholder',
    'autofocus', 'autocomplete', 'step', 'min', 'max', 'results'
    )
    );
     
    tenants likes this.
  8. DSF

    DSF Well-Known Member

    No

    This is the input in ACP
    1.jpg

    And the result in the Sidebar via Hook
    2.jpg
     
  9. ragtek

    ragtek Guest

    {xen:raw XenOptions.field_id} should work;)
     
  10. DSF

    DSF Well-Known Member

    No

    Listener
    Code:
    public static function templateHook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
        {
            switch ($hookName)
            {
                case 'ad_sidebar_below_visitor_panel':
                {
                    $contents .= $template->create('DSF_Miniinfo_Short', $template->getParams());
                    break;         
                }
            }
        }
    
    Template
    Code:
    ...
    <span style="color:#65a5d1;">{xen:raw $XenOptions.DSF_Miniinfo_Short}</span>
    ...
    
    I think her must be a Format-Parameter
    3.jpg
     
  11. ragtek

    ragtek Guest

    For me it's wokring nice


    template code:
    HTML:
    <span style="color:#65a5d1;">container:{xen:raw $xenOptions.ragtek_test}</span>
     

    Attached Files:

  12. DSF

    DSF Well-Known Member

    Well, now it's ok for me. ;)
    Thank you
     

Share This Page