joomla组建开发中使用tab

今天在研究AlphaUserPoints组建的时候,想把里面的用户页面(user profile)里面的一些不需要的东西去掉,这个比较简单,就是编辑/components/com_alphauserpoints/views/account/tmpl/default.php文件就可以了,对应的修改别的页面就修改views下别的文件夹下的default.php文件。无意中我发现了joomla的JPane classes,在官网上看看它的介绍,

This page's content makes references relevant only for Joomla! CMS Version(s) Joomla 1.5 and earlier  
The use of "JPane" has been deprecated from Joomla 1.6 and later Versions, please use: JHTLTabs.

JPane class types include 'Tabs' and 'Sliders'.

Sliders implement the mootools accordian effect. Examples are the Joomla Admin parameters settings. Tabs also implement mootools (but in which degree?)

startPane and endPane() require a string identifier.

JPanes contain Panels

startPanel() and endPanel() require name and ID parameters.

You can set some options in the getInstance method.

翻译下:

JPane类的类型包括“标签”和“滑块”。
滑块实现MooTools的手风琴效果。例子是Joomla管理参数设置。标签也实现了mootools的(但在何种程度呢?)
startPane和endPane()需要一个字符串标识符。
JPanes包含面板
startPanel()和endPanel()的名称和ID参数。
您可以设置一些选项中的getInstance方法。



什么情况,都已经停用了嘛,搞不懂AlphaUserPoints软件组怎么没改一下,呵呵。不过竟然使用的时候没有什么大的问题。上面的类随便就略过了,反正也不被支持了,我们直接来看看它的替代类吧:

JHtmlTabs类的选项         Options for JHtmlTabs

onActive: A callback function when a tab is activated with two params. 'title' is the tab itself, and 'description' is the tab content.

                这个tab被点击时触发的回调函数,有两个参数:title(tab标题)description(tab描述)

onBackground: A callback function when a tab is backgrounded

                        当一个tab被隐藏后的回调函数;

startOffset: The default tab to start with (zero based index).

                    默认打开的tab

useCookie: Whether or not to use cookies to store tab active state. (boolean) (true | false) // This is not a string. Don't use quotes.

                  是否使用cookies储存tab的活动信息,属性:布尔,不要使用引号,因为它不是字符串。


Example

$options = array(
    'onActive' => 'function(title, description){
        description.setStyle("display", "block");
        title.addClass("open").removeClass("closed");
    }',
    'onBackground' => 'function(title, description){
        description.setStyle("display", "none");
        title.addClass("closed").removeClass("open");
    }',
    'startOffset' => 0,  // 0 starts on the first tab, 1 starts the second, etc...
    'useCookie' => true, // this must not be a string. Don't use quotes.
);
 
echo JHtml::_('tabs.start', 'tab_group_id', $options);
 
echo JHtml::_('tabs.panel', JText::_('PANEL_1_TITLE'), 'panel_1_id');
echo 'Panel 1 content can go here.';
 
echo JHtml::_('tabs.panel', JText::_('PANEL_2_TITLE'), 'panel_2_id');
echo 'Panel 2 content can go here.';
 
echo JHtml::_('tabs.end');

现在问题出现了,joomla的官网就这么一点东西,那slider呢?升级了怎么就智能tab不能滑动了呢,伤心,我继续研究一下再说。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值