Template problem help please

hi i want my members to be able to choose templates on my site , can i hide the default boonex template and just have mine showing , many thanks

Quote · 22 Oct 2013

Yes, but you need to make a few changes.  I did this on one site; I hid the Uni and Alt template while still allowing members to change the template.  Let me see if I can dig up the code changes.

Geeks, making the world a better place
Quote · 22 Oct 2013

The list of templates is in the BxBaseMenuBottom.php file

        function getListTemplate($sCurrent)
        {
            $sOutputCode = "";

            $aTemplates = get_templates_array();
            if(count($aTemplates) < 2)
                return $sOutputCode;

            $sGetTransfer = bx_encode_url_params($_GET, array('skin'));

            $aTmplVars = array();
            foreach($aTemplates as $sName => $sTitle) {
                $aTmplVars[] = array (
                    'bx_if:show_icon' => array (
                        'condition' => false,
                        'content' => array(),
                    ),
                    'class' => $sName == $sCurrent ? 'sys-bm-sub-item-selected' : '',
                    'link'    => bx_html_attribute($_SERVER['PHP_SELF']) . '?' . $sGetTransfer . 'skin=' . $sName,
                    'onclick' => '',
                    'title'   => $sTitle
                );
            }

            $sOutputCode .= $GLOBALS['oSysTemplate']->parseHtmlByName( 'extra_bottom_menu_sub_items.html', array(
                'name_method' => 'Template',
                'name_block' => 'template',
                'bx_repeat:items' => $aTmplVars
            ));

            return PopupBox('sys-bm-switcher-template', _t('_sys_bm_popup_cpt_design'), $sOutputCode);
        }
    }

Changes:

        function getListTemplate($sCurrent)
        {
            $sOutputCode = "";

            $aTemplates = get_templates_array();
            if(count($aTemplates) < 2)
                return $sOutputCode;

            $sGetTransfer = bx_encode_url_params($_GET, array('skin'));

            $aTmplVars = array();
            foreach($aTemplates as $sName => $sTitle) {
            if($sTitle == 'UNI') continue;
                $aTmplVars[] = array (
                    'bx_if:show_icon' => array (
                        'condition' => false,
                        'content' => array(),
                    ),
                    'class' => $sName == $sCurrent ? 'sys-bm-sub-item-selected' : '',
                    'link'    => BX_DOL_URL_ROOT . '?' . $sGetTransfer . 'skin=' . $sName,
                    'onclick' => '',
                    'title'   => $sTitle
                );
            }

            $sOutputCode .= $GLOBALS['oSysTemplate']->parseHtmlByName( 'extra_bottom_menu_sub_items.html', array(
                'name_method' => 'Template',
                'name_block' => 'template',
                'bx_repeat:items' => $aTmplVars
            ));

            return PopupBox('sys-bm-switcher-template', _t('_sys_bm_popup_cpt_design'), $sOutputCode);
        }
    }

Basically you skip adding the template UNI to the list of templates that can be selected by still keeping the UNI template in place since it is used by the system.

Geeks, making the world a better place
Quote · 22 Oct 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.