{{indexmenu_n>100}}
====== Group CPs: Tabs ======
Since the version r409, it is possible to group content parts for the FE. E.g. with this function you can be combinedin CPs in Tab's.
This shows an example of the simple [[http://mootools.net/forge/p/mgfx_tabs|MGFX.Tabs]] //(Fixed Height)// for MooTools.
\\
===== Frontend: =====
{{:deutsch:phpwcms-system:artikel:scripte:mgfx-tabs1-01-fe_1.gif|}}
{{:deutsch:phpwcms-system:artikel:scripte:mgfx-tabs1-02-fe_1.gif|}}
{{:deutsch:phpwcms-system:artikel:scripte:mgfx-tabs1-03-fe_1.gif|}}
===== Backend: =====
{{:deutsch:phpwcms-system:artikel:scripte:mgfx-tabs-00-be_1.gif|}}
{{:deutsch:phpwcms-system:artikel:scripte:mgfx-tabs-01-be_1.gif|}}
{{:deutsch:phpwcms-system:artikel:scripte:mgfx-tabs-02-be_1.gif|}}
{{:deutsch:phpwcms-system:artikel:scripte:mgfx-tabs-03-be_1.gif|}}
\\
====== ======
----
Docu: -- \\
Forum: -- \\
Basis: [[http://mootools.net/forge/p/mgfx_tabs]]
**Author:** K.Heermann (flip-flop) http://planmatrix.de //2011/03/21 // \\
**CMS version:** >= V1.47 r409\\
**Version:** V1.0 \\
**Update:** -- \\
**Tag:** --
Filename: **mootools.MGFXrotater.js** \\
Folder: ** /template/lib/mootools/plugin-1.2/ **
Filename: **mootools.MGFXtabs.js** \\
Folder: ** /template/lib/mootools/plugin-1.2/ **
Filename: **cp_register_tabs.php** \\
Folder: ** /template/inc_script/frontend_render/ **
Filename: **MGFXstyle.css** \\
Folder: ** /template/inc_css/specific/mootools/ **
/*
---
script: tabs.js
description: MGFX.Tabs, extension of base class that adds tabs to control the rotater.
authors: Sean McArthur (http://seanmonstar.com)
license: MIT-style license
requires:
core/1.3.0: [Event, Element.Event, Fx.CSS]
more/1.3.0.1: [Fx.Elements]
provides: [MGFX.Tabs]
...
*/
//MGFX.Tabs. Copyright (c) 2008-2010 Sean McArthur
\\
~~UP~~
==== CSS ====
Example from [[http://seanmonstar.github.com/MGFX.Tabs/|MGFX.Tabs]]
**File:** template/inc_css/specific/mootools/MGFXstyle.css
.tab-regcard {
background-color:#ccccee;
position:relative;
height:215px;
width:450px;
padding:5px 5px 5px 10px;
margin-bottom:10px;
border: 1px solid #9596ef;
margin-top: -1px;
z-index: 10;
}
.tab-content {
/* background-color:#ddd; */
height:215px;
position:absolute;
width:450px;
overflow:hidden;
}
.tab-content img {
border:none;
}
.tab-navigation {
margin-left:0;
margin-bottom:0;
padding: 0 0 5px 0;
z-index: 20;
position:relative;
}
.tab-navigation li {
background-color:transparent;
display:inline;
float:none;
list-style:none;
}
.tab-navigation li a {
background-color:#9596ef;
color:#fff;
font-weight: bold;
display:inline;
height:auto;
padding:5px 20px 5px 20px;
text-decoration:none;
width:auto;
border: 1px solid transparent;
border-bottom: none;
z-index: 20;
}
.tab-navigation li.active a {
background-color:#ccccee;
color:#000;
border: 1px solid #9596ef;
border-bottom: none;
}
\\
Is a scroll bar on the right side allowed,
{{:deutsch:phpwcms-system:artikel:scripte:mgfx-tabs1-03_1-fe_1.gif|}}
please complete the following classes:
.tab-regcard {
height:220px; /* Aendern von 215 nach 220 */
}
.tab-content {
height:220px; /* Aendern von 215 nach 220 */
/* overflow: hidden; */ /* Auskommetieren */
overflow-y: scroll; /* Scrollbalken immer vorhanden */
/* overfolw-y: auto; */ /* Alternativ: Scrollbalken wird eingeblendet wenn notwendig */
}
\\
~~UP~~
==== PHP ====
This small Script is necessarily to adapt the autom. generated source text of the CMS to the requirements of the used TAB Script. First and foremost, any tab is extendet with the class "**.tab-it**" erweitert. Last but not least an all the tabs surrounding container **%%
window.addEvent(\'domready\',function(){
this.tabs = new MGFX.Tabs(\'.tab-it\',\'.tab-content\',{
autoplay: false,
transitionDuration:500,
slideInterval:3000,
hover: true
});
});
';
$block['custom_htmlhead']['MGFXtabs.js'] = $js;
// Customize the html source (add the class "tab-it")
$content["all"] = str_replace('tab-item-','tab-it tab-item-',$content["all"]);
// Insert the class tab-regcard between last and first
$content["all"] = preg_replace('/\
\\
==== Original HTML ====
Given source:
-- CONTENT --
-- CONTENT --
-- CONTENT --
Invoke the constructor. \\
The first argument is the tab buttons, the second argument is the tab panes. A third optional argument is a set of options to override the defaults. //(see PHP-Script)//.
##%% var tabs = new MGFX.Tabs('#tabs li a', '#home .feature'); %%##
\\
==== CMS generated HTML ====
With the initialization: ##%% var tabs = new MGFX.Tabs('.tab-it','.tab-content');%%## //(see PHP-Script)//
-- CONTENT --
-- CONTENT --
-- CONTENT --
\\
==== CMS-generated HTML with PHP and JS ====
With the initialization: ##%% var tabs = new MGFX.Tabs('.tab-it','.tab-content');%%## //(see PHP-Script)// \\
-- CP-CONTENT --
\\
The generated source by the CMS in FE is adjusted with the PHP script to the original edition.
With this new feature and a small PHP script, you can use various TAB scripts.
\\