1. REGISTRATION REQUIREMENTS:

    Your username here MUST MATCH your XenForo username (connected to your XF license).

    Once you have registered here, then you need to start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Default category when creating new items

Discussion in 'Showcase Support' started by jOOc, Dec 8, 2014.

  1. jOOc

    jOOc Member Showcase

    When I create a new item in Showcase its always the last category that is default in the create item list. Can this be changed?
     
  2. Bob

    Bob Developer Staff Member

    hmm, there is nothing set to "default" as "checked", so if that is happening, it could be a browser issue. Which browser (and version of that browser) is this happening on?
     
  3. jOOc

    jOOc Member Showcase

    Here is how the source code look like in the browser

    upload_2014-12-8_17-54-6.png

    In IE11 "Category 2" is chosen as default
    In Chrome39 "Category 3" is chosen as default
     
  4. Bob

    Bob Developer Staff Member

  5. jOOc

    jOOc Member Showcase

    That looked better, the first empty option was default and no "selected" in the code for the option list.
    Maybe some add-on that is doing this. I have many so will take me some time to check.
     
  6. Bob

    Bob Developer Staff Member

    btw, there is ONE rule exception to this with the new "Create Item" button that is located in FORUMS (next to the create thread button) that are associated to Showcase Categories. It will "pre select" the showcase category that is associated with that Forum... if there are multiples, it will select the last (because its within a loop). There is no way to "pick" which one is pre selected. You'd be better off just removing that check from the template.

    template name: nflj_showcase_choose_category
    HTML:
                <select name="category_id" class="textCtrl" id="ctrl_category_id" autofocus="true">
                    <option value="0">&nbsp;</option>
                    <xen:foreach loop="$categories" key="$categoryId" value="$_category">
                        <option value="{$categoryId}"
                            {xen:if '!{$_category.allow_items} or !{$_category.canCreateItem}', 'disabled="disabled"'}
                            {xen:if '{$_category.thread_node_id} == {$nodeId}', 'selected="selected"'}  
                            >{xen:string repeat, '&nbsp; ', $_category.depth}{$_category.category_name}</option>
                    </xen:foreach>
                </select>
    remove this:
    HTML:
    {xen:if '{$_category.thread_node_id} == {$nodeId}', 'selected="selected"'}  
     
    Optic likes this.
  7. jOOc

    jOOc Member Showcase

    Yes that did it. Thank you
     
  8. Bob

    Bob Developer Staff Member

    no problemo :)
     
    jOOc likes this.
  9. Optic

    Optic New Member AMS Premium

    Just wanted to say I had this issue too, removing the IF statement fixed it for me too - thanks. :)
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.